api/laravel/Database/Eloquent/Relations/BelongsTo.yaml
2024-09-26 02:03:21 -07:00

285 lines
7.6 KiB
YAML

name: BelongsTo
class_comment: '# * @template TRelatedModel of \Illuminate\Database\Eloquent\Model
# * @template TDeclaringModel of \Illuminate\Database\Eloquent\Model
# *
# * @extends \Illuminate\Database\Eloquent\Relations\Relation<TRelatedModel, TDeclaringModel,
?TRelatedModel>'
dependencies:
- name: BackedEnum
type: class
source: BackedEnum
- name: Builder
type: class
source: Illuminate\Database\Eloquent\Builder
- name: Collection
type: class
source: Illuminate\Database\Eloquent\Collection
- name: Model
type: class
source: Illuminate\Database\Eloquent\Model
- name: ComparesRelatedModels
type: class
source: Illuminate\Database\Eloquent\Relations\Concerns\ComparesRelatedModels
- name: InteractsWithDictionary
type: class
source: Illuminate\Database\Eloquent\Relations\Concerns\InteractsWithDictionary
- name: SupportsDefaultModels
type: class
source: Illuminate\Database\Eloquent\Relations\Concerns\SupportsDefaultModels
properties:
- name: child
visibility: protected
comment: "# * @template TRelatedModel of \\Illuminate\\Database\\Eloquent\\Model\n\
# * @template TDeclaringModel of \\Illuminate\\Database\\Eloquent\\Model\n# *\n\
# * @extends \\Illuminate\\Database\\Eloquent\\Relations\\Relation<TRelatedModel,\
\ TDeclaringModel, ?TRelatedModel>\n# */\n# class BelongsTo extends Relation\n\
# {\n# use ComparesRelatedModels,\n# InteractsWithDictionary,\n# SupportsDefaultModels;\n\
# \n# /**\n# * The child model instance of the relation.\n# *\n# * @var TDeclaringModel"
- name: foreignKey
visibility: protected
comment: '# * The foreign key of the parent model.
# *
# * @var string'
- name: ownerKey
visibility: protected
comment: '# * The associated key on the parent model.
# *
# * @var string'
- name: relationName
visibility: protected
comment: '# * The name of the relationship.
# *
# * @var string'
methods:
- name: __construct
visibility: public
parameters:
- name: query
- name: child
- name: foreignKey
- name: ownerKey
- name: relationName
comment: "# * @template TRelatedModel of \\Illuminate\\Database\\Eloquent\\Model\n\
# * @template TDeclaringModel of \\Illuminate\\Database\\Eloquent\\Model\n# *\n\
# * @extends \\Illuminate\\Database\\Eloquent\\Relations\\Relation<TRelatedModel,\
\ TDeclaringModel, ?TRelatedModel>\n# */\n# class BelongsTo extends Relation\n\
# {\n# use ComparesRelatedModels,\n# InteractsWithDictionary,\n# SupportsDefaultModels;\n\
# \n# /**\n# * The child model instance of the relation.\n# *\n# * @var TDeclaringModel\n\
# */\n# protected $child;\n# \n# /**\n# * The foreign key of the parent model.\n\
# *\n# * @var string\n# */\n# protected $foreignKey;\n# \n# /**\n# * The associated\
\ key on the parent model.\n# *\n# * @var string\n# */\n# protected $ownerKey;\n\
# \n# /**\n# * The name of the relationship.\n# *\n# * @var string\n# */\n# protected\
\ $relationName;\n# \n# /**\n# * Create a new belongs to relationship instance.\n\
# *\n# * @param \\Illuminate\\Database\\Eloquent\\Builder<TRelatedModel> $query\n\
# * @param TDeclaringModel $child\n# * @param string $foreignKey\n# * @param\
\ string $ownerKey\n# * @param string $relationName\n# * @return void"
- name: getResults
visibility: public
parameters: []
comment: '# @inheritDoc'
- name: addConstraints
visibility: public
parameters: []
comment: '# * Set the base constraints on the relation query.
# *
# * @return void'
- name: addEagerConstraints
visibility: public
parameters:
- name: models
comment: '# @inheritDoc'
- name: getEagerModelKeys
visibility: protected
parameters:
- name: models
comment: '# * Gather the keys from an array of related models.
# *
# * @param array<int, TDeclaringModel> $models
# * @return array'
- name: initRelation
visibility: public
parameters:
- name: models
- name: relation
comment: '# @inheritDoc'
- name: match
visibility: public
parameters:
- name: models
- name: results
- name: relation
comment: '# @inheritDoc'
- name: associate
visibility: public
parameters:
- name: model
comment: '# * Associate the model instance to the given parent.
# *
# * @param TRelatedModel|int|string|null $model
# * @return TDeclaringModel'
- name: dissociate
visibility: public
parameters: []
comment: '# * Dissociate previously associated model from the given parent.
# *
# * @return TDeclaringModel'
- name: disassociate
visibility: public
parameters: []
comment: '# * Alias of "dissociate" method.
# *
# * @return TDeclaringModel'
- name: getRelationExistenceQuery
visibility: public
parameters:
- name: query
- name: parentQuery
- name: columns
default: '[''*'']'
comment: '# @inheritDoc'
- name: getRelationExistenceQueryForSelfRelation
visibility: public
parameters:
- name: query
- name: parentQuery
- name: columns
default: '[''*'']'
comment: '# * Add the constraints for a relationship query on the same table.
# *
# * @param \Illuminate\Database\Eloquent\Builder<TRelatedModel> $query
# * @param \Illuminate\Database\Eloquent\Builder<TDeclaringModel> $parentQuery
# * @param array|mixed $columns
# * @return \Illuminate\Database\Eloquent\Builder<TRelatedModel>'
- name: relationHasIncrementingId
visibility: protected
parameters: []
comment: '# * Determine if the related model has an auto-incrementing ID.
# *
# * @return bool'
- name: newRelatedInstanceFor
visibility: protected
parameters:
- name: parent
comment: '# * Make a new related instance for the given model.
# *
# * @param TDeclaringModel $parent
# * @return TRelatedModel'
- name: getChild
visibility: public
parameters: []
comment: '# * Get the child of the relationship.
# *
# * @return TDeclaringModel'
- name: getForeignKeyName
visibility: public
parameters: []
comment: '# * Get the foreign key of the relationship.
# *
# * @return string'
- name: getQualifiedForeignKeyName
visibility: public
parameters: []
comment: '# * Get the fully qualified foreign key of the relationship.
# *
# * @return string'
- name: getParentKey
visibility: public
parameters: []
comment: '# * Get the key value of the child''s foreign key.
# *
# * @return mixed'
- name: getOwnerKeyName
visibility: public
parameters: []
comment: '# * Get the associated key of the relationship.
# *
# * @return string'
- name: getQualifiedOwnerKeyName
visibility: public
parameters: []
comment: '# * Get the fully qualified associated key of the relationship.
# *
# * @return string'
- name: getRelatedKeyFrom
visibility: protected
parameters:
- name: model
comment: '# * Get the value of the model''s foreign key.
# *
# * @param TRelatedModel $model
# * @return int|string'
- name: getForeignKeyFrom
visibility: protected
parameters:
- name: model
comment: '# * Get the value of the model''s foreign key.
# *
# * @param TDeclaringModel $model
# * @return mixed'
- name: getRelationName
visibility: public
parameters: []
comment: '# * Get the name of the relationship.
# *
# * @return string'
traits:
- BackedEnum
- Illuminate\Database\Eloquent\Builder
- Illuminate\Database\Eloquent\Collection
- Illuminate\Database\Eloquent\Model
- Illuminate\Database\Eloquent\Relations\Concerns\ComparesRelatedModels
- Illuminate\Database\Eloquent\Relations\Concerns\InteractsWithDictionary
- Illuminate\Database\Eloquent\Relations\Concerns\SupportsDefaultModels
- ComparesRelatedModels
interfaces: []