platform/api/laravel/Database/Eloquent/Relations/BelongsToMany.yaml
2024-09-02 10:44:11 -07:00

1538 lines
35 KiB
YAML

name: BelongsToMany
class_comment: '# * @template TRelatedModel of \Illuminate\Database\Eloquent\Model
# * @template TDeclaringModel of \Illuminate\Database\Eloquent\Model
# *
# * @extends \Illuminate\Database\Eloquent\Relations\Relation<TRelatedModel, TDeclaringModel,
\Illuminate\Database\Eloquent\Collection<int, TRelatedModel>>'
dependencies:
- name: Closure
type: class
source: Closure
- name: Arrayable
type: class
source: Illuminate\Contracts\Support\Arrayable
- 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: ModelNotFoundException
type: class
source: Illuminate\Database\Eloquent\ModelNotFoundException
- name: AsPivot
type: class
source: Illuminate\Database\Eloquent\Relations\Concerns\AsPivot
- name: InteractsWithDictionary
type: class
source: Illuminate\Database\Eloquent\Relations\Concerns\InteractsWithDictionary
- name: InteractsWithPivotTable
type: class
source: Illuminate\Database\Eloquent\Relations\Concerns\InteractsWithPivotTable
- name: MySqlGrammar
type: class
source: Illuminate\Database\Query\Grammars\MySqlGrammar
- name: UniqueConstraintViolationException
type: class
source: Illuminate\Database\UniqueConstraintViolationException
- name: Str
type: class
source: Illuminate\Support\Str
- name: InvalidArgumentException
type: class
source: InvalidArgumentException
properties:
- name: table
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, \\Illuminate\\Database\\Eloquent\\Collection<int, TRelatedModel>>\n\
# */\n# class BelongsToMany extends Relation\n# {\n# use InteractsWithDictionary,\
\ InteractsWithPivotTable;\n# \n# /**\n# * The intermediate table for the relation.\n\
# *\n# * @var string"
- name: foreignPivotKey
visibility: protected
comment: '# * The foreign key of the parent model.
# *
# * @var string'
- name: relatedPivotKey
visibility: protected
comment: '# * The associated key of the relation.
# *
# * @var string'
- name: parentKey
visibility: protected
comment: '# * The key name of the parent model.
# *
# * @var string'
- name: relatedKey
visibility: protected
comment: '# * The key name of the related model.
# *
# * @var string'
- name: relationName
visibility: protected
comment: '# * The "name" of the relationship.
# *
# * @var string'
- name: pivotColumns
visibility: protected
comment: '# * The pivot table columns to retrieve.
# *
# * @var array<string|\Illuminate\Contracts\Database\Query\Expression>'
- name: pivotWheres
visibility: protected
comment: '# * Any pivot table restrictions for where clauses.
# *
# * @var array'
- name: pivotWhereIns
visibility: protected
comment: '# * Any pivot table restrictions for whereIn clauses.
# *
# * @var array'
- name: pivotWhereNulls
visibility: protected
comment: '# * Any pivot table restrictions for whereNull clauses.
# *
# * @var array'
- name: pivotValues
visibility: protected
comment: '# * The default values for the pivot columns.
# *
# * @var array'
- name: withTimestamps
visibility: public
comment: '# * Indicates if timestamps are available on the pivot table.
# *
# * @var bool'
- name: pivotCreatedAt
visibility: protected
comment: '# * The custom pivot table column for the created_at timestamp.
# *
# * @var string'
- name: pivotUpdatedAt
visibility: protected
comment: '# * The custom pivot table column for the updated_at timestamp.
# *
# * @var string'
- name: using
visibility: protected
comment: '# * The class name of the custom pivot model to use for the relationship.
# *
# * @var string'
- name: accessor
visibility: protected
comment: '# * The name of the accessor to use for the "pivot" relationship.
# *
# * @var string'
methods:
- name: __construct
visibility: public
parameters:
- name: query
- name: parent
- name: table
- name: foreignPivotKey
- name: relatedPivotKey
- name: parentKey
- name: relatedKey
- name: relationName
default: 'null'
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, \\Illuminate\\Database\\Eloquent\\Collection<int, TRelatedModel>>\n\
# */\n# class BelongsToMany extends Relation\n# {\n# use InteractsWithDictionary,\
\ InteractsWithPivotTable;\n# \n# /**\n# * The intermediate table for the relation.\n\
# *\n# * @var string\n# */\n# protected $table;\n# \n# /**\n# * The foreign key\
\ of the parent model.\n# *\n# * @var string\n# */\n# protected $foreignPivotKey;\n\
# \n# /**\n# * The associated key of the relation.\n# *\n# * @var string\n# */\n\
# protected $relatedPivotKey;\n# \n# /**\n# * The key name of the parent model.\n\
# *\n# * @var string\n# */\n# protected $parentKey;\n# \n# /**\n# * The key name\
\ of the related model.\n# *\n# * @var string\n# */\n# protected $relatedKey;\n\
# \n# /**\n# * The \"name\" of the relationship.\n# *\n# * @var string\n# */\n\
# protected $relationName;\n# \n# /**\n# * The pivot table columns to retrieve.\n\
# *\n# * @var array<string|\\Illuminate\\Contracts\\Database\\Query\\Expression>\n\
# */\n# protected $pivotColumns = [];\n# \n# /**\n# * Any pivot table restrictions\
\ for where clauses.\n# *\n# * @var array\n# */\n# protected $pivotWheres = [];\n\
# \n# /**\n# * Any pivot table restrictions for whereIn clauses.\n# *\n# * @var\
\ array\n# */\n# protected $pivotWhereIns = [];\n# \n# /**\n# * Any pivot table\
\ restrictions for whereNull clauses.\n# *\n# * @var array\n# */\n# protected\
\ $pivotWhereNulls = [];\n# \n# /**\n# * The default values for the pivot columns.\n\
# *\n# * @var array\n# */\n# protected $pivotValues = [];\n# \n# /**\n# * Indicates\
\ if timestamps are available on the pivot table.\n# *\n# * @var bool\n# */\n\
# public $withTimestamps = false;\n# \n# /**\n# * The custom pivot table column\
\ for the created_at timestamp.\n# *\n# * @var string\n# */\n# protected $pivotCreatedAt;\n\
# \n# /**\n# * The custom pivot table column for the updated_at timestamp.\n#\
\ *\n# * @var string\n# */\n# protected $pivotUpdatedAt;\n# \n# /**\n# * The class\
\ name of the custom pivot model to use for the relationship.\n# *\n# * @var string\n\
# */\n# protected $using;\n# \n# /**\n# * The name of the accessor to use for\
\ the \"pivot\" relationship.\n# *\n# * @var string\n# */\n# protected $accessor\
\ = 'pivot';\n# \n# /**\n# * Create a new belongs to many relationship instance.\n\
# *\n# * @param \\Illuminate\\Database\\Eloquent\\Builder<TRelatedModel> $query\n\
# * @param TDeclaringModel $parent\n# * @param string|class-string<TRelatedModel>\
\ $table\n# * @param string $foreignPivotKey\n# * @param string $relatedPivotKey\n\
# * @param string $parentKey\n# * @param string $relatedKey\n# * @param string|null\
\ $relationName\n# * @return void"
- name: resolveTableName
visibility: protected
parameters:
- name: table
comment: '# * Attempt to resolve the intermediate table name from the given string.
# *
# * @param string $table
# * @return string'
- name: addConstraints
visibility: public
parameters: []
comment: '# * Set the base constraints on the relation query.
# *
# * @return void'
- name: performJoin
visibility: protected
parameters:
- name: query
default: 'null'
comment: '# * Set the join clause for the relation query.
# *
# * @param \Illuminate\Database\Eloquent\Builder<TRelatedModel>|null $query
# * @return $this'
- name: addWhereConstraints
visibility: protected
parameters: []
comment: '# * Set the where clause for the relation query.
# *
# * @return $this'
- name: addEagerConstraints
visibility: public
parameters:
- name: models
comment: '# @inheritDoc'
- 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: buildDictionary
visibility: protected
parameters:
- name: results
comment: '# * Build model dictionary keyed by the relation''s foreign key.
# *
# * @param \Illuminate\Database\Eloquent\Collection<int, TRelatedModel> $results
# * @return array<array<string, TRelatedModel>>'
- name: getPivotClass
visibility: public
parameters: []
comment: '# * Get the class being used for pivot models.
# *
# * @return string'
- name: using
visibility: public
parameters:
- name: class
comment: '# * Specify the custom pivot model to use for the relationship.
# *
# * @param string $class
# * @return $this'
- name: as
visibility: public
parameters:
- name: accessor
comment: '# * Specify the custom pivot accessor to use for the relationship.
# *
# * @param string $accessor
# * @return $this'
- name: wherePivot
visibility: public
parameters:
- name: column
- name: operator
default: 'null'
- name: value
default: 'null'
- name: boolean
default: '''and'''
comment: '# * Set a where clause for a pivot table column.
# *
# * @param string|\Illuminate\Contracts\Database\Query\Expression $column
# * @param mixed $operator
# * @param mixed $value
# * @param string $boolean
# * @return $this'
- name: wherePivotBetween
visibility: public
parameters:
- name: column
- name: values
- name: boolean
default: '''and'''
- name: not
default: 'false'
comment: '# * Set a "where between" clause for a pivot table column.
# *
# * @param string|\Illuminate\Contracts\Database\Query\Expression $column
# * @param array $values
# * @param string $boolean
# * @param bool $not
# * @return $this'
- name: orWherePivotBetween
visibility: public
parameters:
- name: column
- name: values
comment: '# * Set a "or where between" clause for a pivot table column.
# *
# * @param string|\Illuminate\Contracts\Database\Query\Expression $column
# * @param array $values
# * @return $this'
- name: wherePivotNotBetween
visibility: public
parameters:
- name: column
- name: values
- name: boolean
default: '''and'''
comment: '# * Set a "where pivot not between" clause for a pivot table column.
# *
# * @param string|\Illuminate\Contracts\Database\Query\Expression $column
# * @param array $values
# * @param string $boolean
# * @return $this'
- name: orWherePivotNotBetween
visibility: public
parameters:
- name: column
- name: values
comment: '# * Set a "or where not between" clause for a pivot table column.
# *
# * @param string|\Illuminate\Contracts\Database\Query\Expression $column
# * @param array $values
# * @return $this'
- name: wherePivotIn
visibility: public
parameters:
- name: column
- name: values
- name: boolean
default: '''and'''
- name: not
default: 'false'
comment: '# * Set a "where in" clause for a pivot table column.
# *
# * @param string|\Illuminate\Contracts\Database\Query\Expression $column
# * @param mixed $values
# * @param string $boolean
# * @param bool $not
# * @return $this'
- name: orWherePivot
visibility: public
parameters:
- name: column
- name: operator
default: 'null'
- name: value
default: 'null'
comment: '# * Set an "or where" clause for a pivot table column.
# *
# * @param string|\Illuminate\Contracts\Database\Query\Expression $column
# * @param mixed $operator
# * @param mixed $value
# * @return $this'
- name: withPivotValue
visibility: public
parameters:
- name: column
- name: value
default: 'null'
comment: '# * Set a where clause for a pivot table column.
# *
# * In addition, new pivot records will receive this value.
# *
# * @param string|\Illuminate\Contracts\Database\Query\Expression|array<string,
string> $column
# * @param mixed $value
# * @return $this
# *
# * @throws \InvalidArgumentException'
- name: orWherePivotIn
visibility: public
parameters:
- name: column
- name: values
comment: '# * Set an "or where in" clause for a pivot table column.
# *
# * @param string $column
# * @param mixed $values
# * @return $this'
- name: wherePivotNotIn
visibility: public
parameters:
- name: column
- name: values
- name: boolean
default: '''and'''
comment: '# * Set a "where not in" clause for a pivot table column.
# *
# * @param string|\Illuminate\Contracts\Database\Query\Expression $column
# * @param mixed $values
# * @param string $boolean
# * @return $this'
- name: orWherePivotNotIn
visibility: public
parameters:
- name: column
- name: values
comment: '# * Set an "or where not in" clause for a pivot table column.
# *
# * @param string $column
# * @param mixed $values
# * @return $this'
- name: wherePivotNull
visibility: public
parameters:
- name: column
- name: boolean
default: '''and'''
- name: not
default: 'false'
comment: '# * Set a "where null" clause for a pivot table column.
# *
# * @param string|\Illuminate\Contracts\Database\Query\Expression $column
# * @param string $boolean
# * @param bool $not
# * @return $this'
- name: wherePivotNotNull
visibility: public
parameters:
- name: column
- name: boolean
default: '''and'''
comment: '# * Set a "where not null" clause for a pivot table column.
# *
# * @param string|\Illuminate\Contracts\Database\Query\Expression $column
# * @param string $boolean
# * @return $this'
- name: orWherePivotNull
visibility: public
parameters:
- name: column
- name: not
default: 'false'
comment: '# * Set a "or where null" clause for a pivot table column.
# *
# * @param string|\Illuminate\Contracts\Database\Query\Expression $column
# * @param bool $not
# * @return $this'
- name: orWherePivotNotNull
visibility: public
parameters:
- name: column
comment: '# * Set a "or where not null" clause for a pivot table column.
# *
# * @param string|\Illuminate\Contracts\Database\Query\Expression $column
# * @return $this'
- name: orderByPivot
visibility: public
parameters:
- name: column
- name: direction
default: '''asc'''
comment: '# * Add an "order by" clause for a pivot table column.
# *
# * @param string|\Illuminate\Contracts\Database\Query\Expression $column
# * @param string $direction
# * @return $this'
- name: findOrNew
visibility: public
parameters:
- name: id
- name: columns
default: '[''*'']'
comment: '# * Find a related model by its primary key or return a new instance of
the related model.
# *
# * @param mixed $id
# * @param array $columns
# * @return ($id is (\Illuminate\Contracts\Support\Arrayable<array-key, mixed>|array<mixed>)
? \Illuminate\Database\Eloquent\Collection<int, TRelatedModel> : TRelatedModel)'
- name: firstOrNew
visibility: public
parameters:
- name: attributes
default: '[]'
- name: values
default: '[]'
comment: '# * Get the first related model record matching the attributes or instantiate
it.
# *
# * @param array $attributes
# * @param array $values
# * @return TRelatedModel'
- name: firstOrCreate
visibility: public
parameters:
- name: attributes
default: '[]'
- name: values
default: '[]'
- name: joining
default: '[]'
- name: touch
default: 'true'
comment: '# * Get the first record matching the attributes. If the record is not
found, create it.
# *
# * @param array $attributes
# * @param array $values
# * @param array $joining
# * @param bool $touch
# * @return TRelatedModel'
- name: createOrFirst
visibility: public
parameters:
- name: attributes
default: '[]'
- name: values
default: '[]'
- name: joining
default: '[]'
- name: touch
default: 'true'
comment: '# * Attempt to create the record. If a unique constraint violation occurs,
attempt to find the matching record.
# *
# * @param array $attributes
# * @param array $values
# * @param array $joining
# * @param bool $touch
# * @return TRelatedModel'
- name: updateOrCreate
visibility: public
parameters:
- name: attributes
- name: values
default: '[]'
- name: joining
default: '[]'
- name: touch
default: 'true'
comment: '# * Create or update a related record matching the attributes, and fill
it with values.
# *
# * @param array $attributes
# * @param array $values
# * @param array $joining
# * @param bool $touch
# * @return TRelatedModel'
- name: find
visibility: public
parameters:
- name: id
- name: columns
default: '[''*'']'
comment: '# * Find a related model by its primary key.
# *
# * @param mixed $id
# * @param array $columns
# * @return ($id is (\Illuminate\Contracts\Support\Arrayable<array-key, mixed>|array<mixed>)
? \Illuminate\Database\Eloquent\Collection<int, TRelatedModel> : TRelatedModel|null)'
- name: findMany
visibility: public
parameters:
- name: ids
- name: columns
default: '[''*'']'
comment: '# * Find multiple related models by their primary keys.
# *
# * @param \Illuminate\Contracts\Support\Arrayable|array $ids
# * @param array $columns
# * @return \Illuminate\Database\Eloquent\Collection<int, TRelatedModel>'
- name: findOrFail
visibility: public
parameters:
- name: id
- name: columns
default: '[''*'']'
comment: '# * Find a related model by its primary key or throw an exception.
# *
# * @param mixed $id
# * @param array $columns
# * @return ($id is (\Illuminate\Contracts\Support\Arrayable<array-key, mixed>|array<mixed>)
? \Illuminate\Database\Eloquent\Collection<int, TRelatedModel> : TRelatedModel)
# *
# * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<TRelatedModel>'
- name: findOr
visibility: public
parameters:
- name: id
- name: columns
default: '[''*'']'
- name: callback
default: 'null'
comment: '# * Find a related model by its primary key or call a callback.
# *
# * @template TValue
# *
# * @param mixed $id
# * @param (\Closure(): TValue)|list<string>|string $columns
# * @param (\Closure(): TValue)|null $callback
# * @return (
# * $id is (\Illuminate\Contracts\Support\Arrayable<array-key, mixed>|array<mixed>)
# * ? \Illuminate\Database\Eloquent\Collection<int, TRelatedModel>|TValue
# * : TRelatedModel|TValue
# * )'
- name: firstWhere
visibility: public
parameters:
- name: column
- name: operator
default: 'null'
- name: value
default: 'null'
- name: boolean
default: '''and'''
comment: '# * Add a basic where clause to the query, and return the first result.
# *
# * @param \Closure|string|array $column
# * @param mixed $operator
# * @param mixed $value
# * @param string $boolean
# * @return TRelatedModel|null'
- name: first
visibility: public
parameters:
- name: columns
default: '[''*'']'
comment: '# * Execute the query and get the first result.
# *
# * @param array $columns
# * @return TRelatedModel|null'
- name: firstOrFail
visibility: public
parameters:
- name: columns
default: '[''*'']'
comment: '# * Execute the query and get the first result or throw an exception.
# *
# * @param array $columns
# * @return TRelatedModel
# *
# * @throws \Illuminate\Database\Eloquent\ModelNotFoundException<TRelatedModel>'
- name: firstOr
visibility: public
parameters:
- name: columns
default: '[''*'']'
- name: callback
default: 'null'
comment: '# * Execute the query and get the first result or call a callback.
# *
# * @template TValue
# *
# * @param (\Closure(): TValue)|list<string> $columns
# * @param (\Closure(): TValue)|null $callback
# * @return TRelatedModel|TValue'
- name: getResults
visibility: public
parameters: []
comment: '# @inheritDoc'
- name: get
visibility: public
parameters:
- name: columns
default: '[''*'']'
comment: '# @inheritDoc'
- name: shouldSelect
visibility: protected
parameters:
- name: columns
default: '[''*'']'
comment: '# * Get the select columns for the relation query.
# *
# * @param array $columns
# * @return array'
- name: aliasedPivotColumns
visibility: protected
parameters: []
comment: '# * Get the pivot columns for the relation.
# *
# * "pivot_" is prefixed at each column for easy removal later.
# *
# * @return array'
- name: paginate
visibility: public
parameters:
- name: perPage
default: 'null'
- name: columns
default: '[''*'']'
- name: pageName
default: '''page'''
- name: page
default: 'null'
comment: '# * Get a paginator for the "select" statement.
# *
# * @param int|null $perPage
# * @param array $columns
# * @param string $pageName
# * @param int|null $page
# * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator'
- name: simplePaginate
visibility: public
parameters:
- name: perPage
default: 'null'
- name: columns
default: '[''*'']'
- name: pageName
default: '''page'''
- name: page
default: 'null'
comment: '# * Paginate the given query into a simple paginator.
# *
# * @param int|null $perPage
# * @param array $columns
# * @param string $pageName
# * @param int|null $page
# * @return \Illuminate\Contracts\Pagination\Paginator'
- name: cursorPaginate
visibility: public
parameters:
- name: perPage
default: 'null'
- name: columns
default: '[''*'']'
- name: cursorName
default: '''cursor'''
- name: cursor
default: 'null'
comment: '# * Paginate the given query into a cursor paginator.
# *
# * @param int|null $perPage
# * @param array $columns
# * @param string $cursorName
# * @param string|null $cursor
# * @return \Illuminate\Contracts\Pagination\CursorPaginator'
- name: chunk
visibility: public
parameters:
- name: count
- name: callback
comment: '# * Chunk the results of the query.
# *
# * @param int $count
# * @param callable $callback
# * @return bool'
- name: chunkById
visibility: public
parameters:
- name: count
- name: callback
- name: column
default: 'null'
- name: alias
default: 'null'
comment: '# * Chunk the results of a query by comparing numeric IDs.
# *
# * @param int $count
# * @param callable $callback
# * @param string|null $column
# * @param string|null $alias
# * @return bool'
- name: chunkByIdDesc
visibility: public
parameters:
- name: count
- name: callback
- name: column
default: 'null'
- name: alias
default: 'null'
comment: '# * Chunk the results of a query by comparing IDs in descending order.
# *
# * @param int $count
# * @param callable $callback
# * @param string|null $column
# * @param string|null $alias
# * @return bool'
- name: eachById
visibility: public
parameters:
- name: callback
- name: count
default: '1000'
- name: column
default: 'null'
- name: alias
default: 'null'
comment: '# * Execute a callback over each item while chunking by ID.
# *
# * @param callable $callback
# * @param int $count
# * @param string|null $column
# * @param string|null $alias
# * @return bool'
- name: orderedChunkById
visibility: public
parameters:
- name: count
- name: callback
- name: column
default: 'null'
- name: alias
default: 'null'
- name: descending
default: 'false'
comment: '# * Chunk the results of a query by comparing IDs in a given order.
# *
# * @param int $count
# * @param callable $callback
# * @param string|null $column
# * @param string|null $alias
# * @param bool $descending
# * @return bool'
- name: each
visibility: public
parameters:
- name: callback
- name: count
default: '1000'
comment: '# * Execute a callback over each item while chunking.
# *
# * @param callable $callback
# * @param int $count
# * @return bool'
- name: lazy
visibility: public
parameters:
- name: chunkSize
default: '1000'
comment: '# * Query lazily, by chunks of the given size.
# *
# * @param int $chunkSize
# * @return \Illuminate\Support\LazyCollection<int, TRelatedModel>'
- name: lazyById
visibility: public
parameters:
- name: chunkSize
default: '1000'
- name: column
default: 'null'
- name: alias
default: 'null'
comment: '# * Query lazily, by chunking the results of a query by comparing IDs.
# *
# * @param int $chunkSize
# * @param string|null $column
# * @param string|null $alias
# * @return \Illuminate\Support\LazyCollection<int, TRelatedModel>'
- name: lazyByIdDesc
visibility: public
parameters:
- name: chunkSize
default: '1000'
- name: column
default: 'null'
- name: alias
default: 'null'
comment: '# * Query lazily, by chunking the results of a query by comparing IDs
in descending order.
# *
# * @param int $chunkSize
# * @param string|null $column
# * @param string|null $alias
# * @return \Illuminate\Support\LazyCollection<int, TRelatedModel>'
- name: cursor
visibility: public
parameters: []
comment: '# * Get a lazy collection for the given query.
# *
# * @return \Illuminate\Support\LazyCollection<int, TRelatedModel>'
- name: prepareQueryBuilder
visibility: protected
parameters: []
comment: '# * Prepare the query builder for query execution.
# *
# * @return \Illuminate\Database\Eloquent\Builder<TRelatedModel>'
- name: hydratePivotRelation
visibility: protected
parameters:
- name: models
comment: '# * Hydrate the pivot table relationship on the models.
# *
# * @param array<int, TRelatedModel> $models
# * @return void'
- name: migratePivotAttributes
visibility: protected
parameters:
- name: model
comment: '# * Get the pivot attributes from a model.
# *
# * @param TRelatedModel $model
# * @return array'
- name: touchIfTouching
visibility: public
parameters: []
comment: '# * If we''re touching the parent model, touch.
# *
# * @return void'
- name: touchingParent
visibility: protected
parameters: []
comment: '# * Determine if we should touch the parent on sync.
# *
# * @return bool'
- name: guessInverseRelation
visibility: protected
parameters: []
comment: '# * Attempt to guess the name of the inverse of the relation.
# *
# * @return string'
- name: touch
visibility: public
parameters: []
comment: '# * Touch all of the related models for the relationship.
# *
# * E.g.: Touch all roles associated with this user.
# *
# * @return void'
- name: allRelatedIds
visibility: public
parameters: []
comment: '# * Get all of the IDs for the related models.
# *
# * @return \Illuminate\Support\Collection<int, int|string>'
- name: save
visibility: public
parameters:
- name: model
- name: pivotAttributes
default: '[]'
- name: touch
default: 'true'
comment: '# * Save a new model and attach it to the parent model.
# *
# * @param TRelatedModel $model
# * @param array $pivotAttributes
# * @param bool $touch
# * @return TRelatedModel'
- name: saveQuietly
visibility: public
parameters:
- name: model
- name: pivotAttributes
default: '[]'
- name: touch
default: 'true'
comment: '# * Save a new model without raising any events and attach it to the parent
model.
# *
# * @param TRelatedModel $model
# * @param array $pivotAttributes
# * @param bool $touch
# * @return TRelatedModel'
- name: saveMany
visibility: public
parameters:
- name: models
- name: pivotAttributes
default: '[]'
comment: '# * Save an array of new models and attach them to the parent model.
# *
# * @template TContainer of \Illuminate\Support\Collection<array-key, TRelatedModel>|array<array-key,
TRelatedModel>
# *
# * @param TContainer $models
# * @param array $pivotAttributes
# * @return TContainer'
- name: saveManyQuietly
visibility: public
parameters:
- name: models
- name: pivotAttributes
default: '[]'
comment: '# * Save an array of new models without raising any events and attach
them to the parent model.
# *
# * @template TContainer of \Illuminate\Support\Collection<array-key, TRelatedModel>|array<array-key,
TRelatedModel>
# *
# * @param TContainer $models
# * @param array $pivotAttributes
# * @return TContainer'
- name: create
visibility: public
parameters:
- name: attributes
default: '[]'
- name: joining
default: '[]'
- name: touch
default: 'true'
comment: '# * Create a new instance of the related model.
# *
# * @param array $attributes
# * @param array $joining
# * @param bool $touch
# * @return TRelatedModel'
- name: createMany
visibility: public
parameters:
- name: records
- name: joinings
default: '[]'
comment: '# * Create an array of new instances of the related models.
# *
# * @param iterable $records
# * @param array $joinings
# * @return array<int, TRelatedModel>'
- name: getRelationExistenceQuery
visibility: public
parameters:
- name: query
- name: parentQuery
- name: columns
default: '[''*'']'
comment: '# @inheritDoc'
- name: getRelationExistenceQueryForSelfJoin
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: take
visibility: public
parameters:
- name: value
comment: '# * Alias to set the "limit" value of the query.
# *
# * @param int $value
# * @return $this'
- name: limit
visibility: public
parameters:
- name: value
comment: '# * Set the "limit" value of the query.
# *
# * @param int $value
# * @return $this'
- name: getExistenceCompareKey
visibility: public
parameters: []
comment: '# * Get the key for comparing against the parent key in "has" query.
# *
# * @return string'
- name: withTimestamps
visibility: public
parameters:
- name: createdAt
default: 'null'
- name: updatedAt
default: 'null'
comment: '# * Specify that the pivot table has creation and update timestamps.
# *
# * @param mixed $createdAt
# * @param mixed $updatedAt
# * @return $this'
- name: createdAt
visibility: public
parameters: []
comment: '# * Get the name of the "created at" column.
# *
# * @return string'
- name: updatedAt
visibility: public
parameters: []
comment: '# * Get the name of the "updated at" column.
# *
# * @return string'
- name: getForeignPivotKeyName
visibility: public
parameters: []
comment: '# * Get the foreign key for the relation.
# *
# * @return string'
- name: getQualifiedForeignPivotKeyName
visibility: public
parameters: []
comment: '# * Get the fully qualified foreign key for the relation.
# *
# * @return string'
- name: getRelatedPivotKeyName
visibility: public
parameters: []
comment: '# * Get the "related key" for the relation.
# *
# * @return string'
- name: getQualifiedRelatedPivotKeyName
visibility: public
parameters: []
comment: '# * Get the fully qualified "related key" for the relation.
# *
# * @return string'
- name: getParentKeyName
visibility: public
parameters: []
comment: '# * Get the parent key for the relationship.
# *
# * @return string'
- name: getQualifiedParentKeyName
visibility: public
parameters: []
comment: '# * Get the fully qualified parent key name for the relation.
# *
# * @return string'
- name: getRelatedKeyName
visibility: public
parameters: []
comment: '# * Get the related key for the relationship.
# *
# * @return string'
- name: getQualifiedRelatedKeyName
visibility: public
parameters: []
comment: '# * Get the fully qualified related key name for the relation.
# *
# * @return string'
- name: getTable
visibility: public
parameters: []
comment: '# * Get the intermediate table for the relationship.
# *
# * @return string'
- name: getRelationName
visibility: public
parameters: []
comment: '# * Get the relationship name for the relationship.
# *
# * @return string'
- name: getPivotAccessor
visibility: public
parameters: []
comment: '# * Get the name of the pivot accessor for this relationship.
# *
# * @return string'
- name: getPivotColumns
visibility: public
parameters: []
comment: '# * Get the pivot columns for this relationship.
# *
# * @return array'
- name: qualifyPivotColumn
visibility: public
parameters:
- name: column
comment: '# * Qualify the given column name by the pivot table.
# *
# * @param string|\Illuminate\Contracts\Database\Query\Expression $column
# * @return string|\Illuminate\Contracts\Database\Query\Expression'
traits:
- Closure
- Illuminate\Contracts\Support\Arrayable
- Illuminate\Database\Eloquent\Builder
- Illuminate\Database\Eloquent\Collection
- Illuminate\Database\Eloquent\Model
- Illuminate\Database\Eloquent\ModelNotFoundException
- Illuminate\Database\Eloquent\Relations\Concerns\AsPivot
- Illuminate\Database\Eloquent\Relations\Concerns\InteractsWithDictionary
- Illuminate\Database\Eloquent\Relations\Concerns\InteractsWithPivotTable
- Illuminate\Database\Query\Grammars\MySqlGrammar
- Illuminate\Database\UniqueConstraintViolationException
- Illuminate\Support\Str
- InvalidArgumentException
- InteractsWithDictionary
interfaces: []