Contents

October\Rain\Database\Relations\HasOneThrough

Extends
  • Illuminate\Database\Eloquent\Relations\HasOneThrough
  • Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough
  • Illuminate\Database\Eloquent\Relations\Relation
Implements
  • Illuminate\Contracts\Database\Eloquent\SupportsPartialRelations
  • Illuminate\Contracts\Database\Eloquent\Builder
  • Illuminate\Contracts\Database\Query\Builder

Public Properties

There are no public properties in the class.

Show inherited public properties

Inherited Public Properties

  • $morphMap - An array to map morph names to their class names in the database. (defined in Illuminate\Database\Eloquent\Relations\Relation)

Protected Properties

protected string $relationName

The "name" of the relationship.

protected bool $pivotSiteScope

pivotSiteScope indicates if pivot queries should be scoped by site_id. This is used for dual-multisite scenarios where both parent and related models use multisite.

Show inherited protected properties

Inherited Protected Properties

  • $throughParent - The "through" parent model instance. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • $farParent - The far parent model instance. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • $firstKey - The near key on the relationship. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • $secondKey - The far key on the relationship. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • $localKey - The local key on the relationship. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • $secondLocalKey - The local key on the intermediary model. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • $query - The Eloquent query builder instance. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • $parent - The parent model instance. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • $related - The related model instance. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • $eagerKeysWereEmpty - Indicates whether the eagerly loaded relation should implicitly return an empty collection. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • $constraints - Indicates if the relation is adding constraints. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • $constraintsForNestedRelations - Indicates whether constraints should be enabled for nested relation attributes. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • $requireMorphMap - Prevents morph relationships without a morph map. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • $selfJoinCount - The count of self joins. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • $macros - The registered string macros. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • $isOneOfMany - Determines whether the relationship is one-of-many. (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • $oneOfManySubQuery - The one of many inner join subselect query builder instance. (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • $withDefault - Indicates if a default model instance should be used. (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)

Public Methods

public __construct()

public __construct(
    $query,
    $farParent,
    $parent,
    $firstKey,
    $secondKey,
    $localKey,
    $secondLocalKey,
    $relationName = null
): void

__construct a new has many relationship instance.

public addDefinedConstraints()

public addDefinedConstraints(): void 

addDefinedConstraints to the relation query

public addDefinedConstraintsToQuery()

public addDefinedConstraintsToQuery($query, $args = null): void

public addDefinedConstraintsToRelation()

public addDefinedConstraintsToRelation($relation, $args = null): void

public isPivotSiteScoped()

public isPivotSiteScoped(): bool 

isPivotSiteScoped returns true if pivot queries should be scoped by site_id.

public parentSoftDeletes()

public parentSoftDeletes(): bool 

parentSoftDeletes determines whether close parent of the relation uses Soft Deletes.

Show inherited public methods

Inherited Public Methods

  • __call() - Handle dynamic method calls to the relationship. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • __callStatic() - Dynamically handle calls to the class. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • __clone() - Force a clone of the underlying query builder when cloning. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • addConstraints() - Set the base constraints on the relation query. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • addEagerConstraints() - (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • addOneOfManyJoinSubQueryConstraints() - (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • addOneOfManySubQueryConstraints() - (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • allRelatedIds() - Get all of the IDs for the related models. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • chunk() - Chunk the results of the query. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • chunkById() - Chunk the results of a query by comparing numeric IDs. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • chunkByIdDesc() - Chunk the results of a query by comparing IDs in descending order. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • chunkMap() - Run a map over each item while chunking. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • createOrFirst() - Attempt to create the record. If a unique constraint violation occurs, attempt to find the matching record. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • createdAt() - Get the name of the "created at" column. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • cursor() - Get a generator for the given query. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • cursorPaginate() - Paginate the given query into a cursor paginator. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • each() - Execute a callback over each item while chunking. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • eachById() - Execute a callback over each item while chunking by ID. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • enforceMorphMap() - Define the morph map for polymorphic relations and require all morphed models to be explicitly mapped. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • find() - Find a related model by its primary key. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • findMany() - Find multiple related models by their primary keys. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • findOr() - Find a related model by its primary key or call a callback. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • findOrFail() - Find a related model by its primary key or throw an exception. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • findOrNew() - Find a related model by its primary key or return a new instance of the related model. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • findSole() - Find a sole related model by its primary key. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • first() - Execute the query and get the first related model. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • firstOr() - Execute the query and get the first result or call a callback. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • firstOrCreate() - Get the first record matching the attributes. If the record is not found, create it. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • firstOrFail() - Execute the query and get the first result or throw an exception. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • firstOrNew() - Get the first related model record matching the attributes or instantiate it. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • firstWhere() - Add a basic where clause to the query, and return the first result. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • flushMacros() - Flush the existing macros. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • get() - (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • getBaseQuery() - Get the base query builder driving the Eloquent builder. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • getEager() - Get the relationship for eager loading. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • getFirstKeyName() - Get the foreign key on the "through" model. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • getForeignKeyName() - Get the foreign key on the related model. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • getLocalKeyName() - Get the local key on the far parent model. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • getMorphAlias() - Get the alias associated with a custom polymorphic class. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • getMorphedModel() - Get the model associated with a custom polymorphic type. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • getOneOfManySubQuery() - Get the one of many inner join subselect builder instance. (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • getOneOfManySubQuerySelectColumns() - (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • getParent() - Get the parent model of the relation. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • getParentKey() - (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • getQualifiedFarKeyName() - Get the qualified foreign key on the related model. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • getQualifiedFirstKeyName() - Get the qualified foreign key on the "through" model. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • getQualifiedForeignKeyName() - Get the qualified foreign key on the related model. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • getQualifiedLocalKeyName() - Get the qualified local key on the far parent model. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • getQualifiedParentKeyName() - Get the fully-qualified parent key name. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • getQuery() - Get the underlying query for the relation. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • getRelated() - Get the related model of the relation. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • getRelatedClass() - Get the class name of the related model. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • getRelationCountHash() - Get a relationship join table hash. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • getRelationExistenceCountQuery() - Add the constraints for a relationship count query. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • getRelationExistenceQuery() - (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • getRelationExistenceQueryForSelfRelation() - Add the constraints for a relationship query on the same table. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • getRelationExistenceQueryForThroughSelfRelation() - Add the constraints for a relationship query on the same table as the through parent. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • getRelationName() - Get the name of the relationship. (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • getResults() - (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • getSecondLocalKeyName() - Get the local key on the intermediary model. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • hasMacro() - Checks if macro is registered. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • incrementOrCreate() - Create a related record matching the attributes, or increment the existing record. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • initRelation() - (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • is() - (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • isNot() - Determine if the model is not the related instance of the relationship. (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • isOneOfMany() - Determine whether the relationship is a one-of-many relationship. (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • latestOfMany() - Indicate that the relation is the latest single result of a larger one-to-many relationship. (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • lazy() - Query lazily, by chunks of the given size. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • lazyById() - Query lazily, by chunking the results of a query by comparing IDs. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • lazyByIdDesc() - Query lazily, by chunking the results of a query by comparing IDs in descending order. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • limit() - Set the "limit" value of the query. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • macro() - Register a custom macro. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • macroCall() - Dynamically handle calls to the class. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • match() - (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • mixin() - Mix another object into the class. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • morphMap() - Set or get the morph map for polymorphic relations. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • newRelatedInstanceFor() - Make a new related instance for the given model. (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • noConstraints() - Run a callback with constraints disabled on the relation. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • noConstraintsForRelation() - Run a callback without constraints while preserving them for nested relation attributes. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • ofMany() - Indicate that the relation is a single result of a larger one-to-many relationship. (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • oldestOfMany() - Indicate that the relation is the oldest single result of a larger one-to-many relationship. (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • paginate() - Get a paginator for the "select" statement. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • qualifySubSelectColumn() - Get the qualified column name for the one-of-many relationship using the subselect join query's alias. (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • rawUpdate() - Run a raw update against the base query. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • relatedUpdatedAt() - Get the name of the related model's "updated at" column. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • requireMorphMap() - Prevent polymorphic relationships from being used without model mappings. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • requiresMorphMap() - Determine if polymorphic relationships require explicit model mapping. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • simplePaginate() - Paginate the given query into a simple paginator. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • sole() - Execute the query and get the first result if it's the sole matching record. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • take() - Alias to set the "limit" value of the query. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • throughParentSoftDeletes() - Determine whether "through" parent of the relation uses Soft Deletes. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • toBase() - Get a base query builder instance. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • touch() - Touch all of the related models for the relationship. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • updateOrCreate() - Create or update a related record matching the attributes, and fill it with values. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • updatedAt() - Get the name of the "updated at" column. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • withConstraints() - Run a callback with constraints enabled on the relation. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • withConstraintsForNestedRelation() - Run a callback with constraints when resolving a nested relation attribute. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • withDefault() - Return a new model instance in case the relationship does not exist. (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • withTrashedParents() - Indicate that trashed "through" parents should be included in the query. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)

Protected Methods

protected addPivotSiteScopeConstraints()

protected addPivotSiteScopeConstraints(): void 

addPivotSiteScopeConstraints adds site_id constraint to pivot queries if enabled.

protected getPivotSiteScopeValue()

protected getPivotSiteScopeValue(): int|null 

getPivotSiteScopeValue returns the current site_id value for pivot records. Returns null if pivotSiteScope is disabled, otherwise returns the site ID.

protected getRelationDefinitionForDefinedConstraints()

protected getRelationDefinitionForDefinedConstraints(): void

getRelationDefinitionForDefinedConstraints returns the relation definition for the relationship context.

Show inherited protected methods

Inherited Protected Methods

  • addOneOfManyJoinSubQuery() - Add the join subquery to the given query on the given column and the relationship's foreign key. (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • buildDictionary() - Build model dictionary keyed by the relation's foreign key. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • buildMorphMapFromModels() - Builds a table-keyed array from model class names. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • compareKeys() - Compare the parent key with the related key. (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • forwardCallTo() - Forward a method call to the given object. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • forwardDecoratedCallTo() - Forward a method call to the given object, returning $this if the forwarded call returned itself. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • getDefaultFor() - Get the default value for this relation. (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • getDefaultOneOfManyJoinAlias() - Get the default alias for the one of many inner join clause. (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • getDictionaryKey() - Get a dictionary key attribute - casting it to a string if necessary. (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • getKeys() - Get all of the primary keys for an array of models. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • getRelatedKeyFrom() - (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • getRelationQuery() - Get the query builder that will contain the relationship constraints. (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • guessRelationship() - Guess the "hasOne" relationship's name via backtrace. (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • mergeOneOfManyJoinsTo() - Merge the relationship query joins to the given query builder. (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • newOneOfManySubQuery() - Get a new query for the related model, grouping the query by the given column, often the foreign key of the relationship. (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • performJoin() - Set the join clause on the query. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • prepareQueryBuilder() - Prepare the query builder for query execution. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • qualifyOneOfManyJoinWithThroughParentAlias() - Point the one-of-many join at the aliased intermediate table of a self-referencing existence query. (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • qualifyRelatedAttributes() - Qualify the given attribute keys with the related model's table. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • qualifyRelatedColumn() - Qualify related column using the related table name if it is not already qualified. (defined in Illuminate\Database\Eloquent\Relations\HasOneThrough)
  • shouldSelect() - Set the select clause for the relation query. (defined in Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough)
  • throwBadMethodCallException() - Throw a bad method call exception for the given method. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • whereInEager() - Add a whereIn eager constraint for the given set of model keys to be loaded. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • whereInMethod() - Get the name of the "where in" method for eager loading. (defined in Illuminate\Database\Eloquent\Relations\Relation)
  • withoutConstraints() - Run a callback with the configured relation constraints. (defined in Illuminate\Database\Eloquent\Relations\Relation)