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

810 lines
21 KiB
YAML

name: Factory
class_comment: null
dependencies:
- name: Closure
type: class
source: Closure
- name: Generator
type: class
source: Faker\Generator
- name: Container
type: class
source: Illuminate\Container\Container
- name: Application
type: class
source: Illuminate\Contracts\Foundation\Application
- name: EloquentCollection
type: class
source: Illuminate\Database\Eloquent\Collection
- name: Model
type: class
source: Illuminate\Database\Eloquent\Model
- name: SoftDeletes
type: class
source: Illuminate\Database\Eloquent\SoftDeletes
- name: Carbon
type: class
source: Illuminate\Support\Carbon
- name: Collection
type: class
source: Illuminate\Support\Collection
- name: Enumerable
type: class
source: Illuminate\Support\Enumerable
- name: Str
type: class
source: Illuminate\Support\Str
- name: Conditionable
type: class
source: Illuminate\Support\Traits\Conditionable
- name: ForwardsCalls
type: class
source: Illuminate\Support\Traits\ForwardsCalls
- name: Macroable
type: class
source: Illuminate\Support\Traits\Macroable
- name: Throwable
type: class
source: Throwable
properties:
- name: model
visibility: protected
comment: "# * @template TModel of \\Illuminate\\Database\\Eloquent\\Model\n# *\n\
# * @method $this trashed()\n# */\n# abstract class Factory\n# {\n# use Conditionable,\
\ ForwardsCalls, Macroable {\n# __call as macroCall;\n# }\n# \n# /**\n# * The\
\ name of the factory's corresponding model.\n# *\n# * @var class-string<TModel>"
- name: count
visibility: protected
comment: '# * The number of models that should be generated.
# *
# * @var int|null'
- name: states
visibility: protected
comment: '# * The state transformations that will be applied to the model.
# *
# * @var \Illuminate\Support\Collection'
- name: has
visibility: protected
comment: '# * The parent relationships that will be applied to the model.
# *
# * @var \Illuminate\Support\Collection'
- name: for
visibility: protected
comment: '# * The child relationships that will be applied to the model.
# *
# * @var \Illuminate\Support\Collection'
- name: recycle
visibility: protected
comment: '# * The model instances to always use when creating relationships.
# *
# * @var \Illuminate\Support\Collection'
- name: afterMaking
visibility: protected
comment: '# * The "after making" callbacks that will be applied to the model.
# *
# * @var \Illuminate\Support\Collection'
- name: afterCreating
visibility: protected
comment: '# * The "after creating" callbacks that will be applied to the model.
# *
# * @var \Illuminate\Support\Collection'
- name: connection
visibility: protected
comment: '# * The name of the database connection that will be used to create the
models.
# *
# * @var string|null'
- name: faker
visibility: protected
comment: '# * The current Faker instance.
# *
# * @var \Faker\Generator'
- name: namespace
visibility: public
comment: '# * The default namespace where factories reside.
# *
# * @var string'
- name: modelNameResolver
visibility: protected
comment: '# * The default model name resolver.
# *
# * @var callable(self): class-string<TModel>'
- name: factoryNameResolver
visibility: protected
comment: '# * The factory name resolver.
# *
# * @var callable'
methods:
- name: __construct
visibility: public
parameters:
- name: count
default: 'null'
- name: states
default: 'null'
- name: has
default: 'null'
- name: for
default: 'null'
- name: afterMaking
default: 'null'
- name: afterCreating
default: 'null'
- name: connection
default: 'null'
- name: recycle
default: 'null'
comment: "# * @template TModel of \\Illuminate\\Database\\Eloquent\\Model\n# *\n\
# * @method $this trashed()\n# */\n# abstract class Factory\n# {\n# use Conditionable,\
\ ForwardsCalls, Macroable {\n# __call as macroCall;\n# }\n# \n# /**\n# * The\
\ name of the factory's corresponding model.\n# *\n# * @var class-string<TModel>\n\
# */\n# protected $model;\n# \n# /**\n# * The number of models that should be\
\ generated.\n# *\n# * @var int|null\n# */\n# protected $count;\n# \n# /**\n#\
\ * The state transformations that will be applied to the model.\n# *\n# * @var\
\ \\Illuminate\\Support\\Collection\n# */\n# protected $states;\n# \n# /**\n#\
\ * The parent relationships that will be applied to the model.\n# *\n# * @var\
\ \\Illuminate\\Support\\Collection\n# */\n# protected $has;\n# \n# /**\n# * The\
\ child relationships that will be applied to the model.\n# *\n# * @var \\Illuminate\\\
Support\\Collection\n# */\n# protected $for;\n# \n# /**\n# * The model instances\
\ to always use when creating relationships.\n# *\n# * @var \\Illuminate\\Support\\\
Collection\n# */\n# protected $recycle;\n# \n# /**\n# * The \"after making\" callbacks\
\ that will be applied to the model.\n# *\n# * @var \\Illuminate\\Support\\Collection\n\
# */\n# protected $afterMaking;\n# \n# /**\n# * The \"after creating\" callbacks\
\ that will be applied to the model.\n# *\n# * @var \\Illuminate\\Support\\Collection\n\
# */\n# protected $afterCreating;\n# \n# /**\n# * The name of the database connection\
\ that will be used to create the models.\n# *\n# * @var string|null\n# */\n#\
\ protected $connection;\n# \n# /**\n# * The current Faker instance.\n# *\n# *\
\ @var \\Faker\\Generator\n# */\n# protected $faker;\n# \n# /**\n# * The default\
\ namespace where factories reside.\n# *\n# * @var string\n# */\n# public static\
\ $namespace = 'Database\\\\Factories\\\\';\n# \n# /**\n# * The default model\
\ name resolver.\n# *\n# * @var callable(self): class-string<TModel>\n# */\n#\
\ protected static $modelNameResolver;\n# \n# /**\n# * The factory name resolver.\n\
# *\n# * @var callable\n# */\n# protected static $factoryNameResolver;\n# \n#\
\ /**\n# * Create a new factory instance.\n# *\n# * @param int|null $count\n\
# * @param \\Illuminate\\Support\\Collection|null $states\n# * @param \\Illuminate\\\
Support\\Collection|null $has\n# * @param \\Illuminate\\Support\\Collection|null\
\ $for\n# * @param \\Illuminate\\Support\\Collection|null $afterMaking\n# *\
\ @param \\Illuminate\\Support\\Collection|null $afterCreating\n# * @param \
\ string|null $connection\n# * @param \\Illuminate\\Support\\Collection|null\
\ $recycle\n# * @return void"
- name: new
visibility: public
parameters:
- name: attributes
default: '[]'
comment: "# * Define the model's default state.\n# *\n# * @return array<string,\
\ mixed>\n# */\n# abstract public function definition();\n# \n# /**\n# * Get a\
\ new factory instance for the given attributes.\n# *\n# * @param (callable(array<string,\
\ mixed>): array<string, mixed>)|array<string, mixed> $attributes\n# * @return\
\ static"
- name: times
visibility: public
parameters:
- name: count
comment: '# * Get a new factory instance for the given number of models.
# *
# * @param int $count
# * @return static'
- name: configure
visibility: public
parameters: []
comment: '# * Configure the factory.
# *
# * @return static'
- name: raw
visibility: public
parameters:
- name: attributes
default: '[]'
- name: parent
default: 'null'
comment: '# * Get the raw attributes generated by the factory.
# *
# * @param (callable(array<string, mixed>): array<string, mixed>)|array<string,
mixed> $attributes
# * @param \Illuminate\Database\Eloquent\Model|null $parent
# * @return array<int|string, mixed>'
- name: createOne
visibility: public
parameters:
- name: attributes
default: '[]'
comment: '# * Create a single model and persist it to the database.
# *
# * @param (callable(array<string, mixed>): array<string, mixed>)|array<string,
mixed> $attributes
# * @return TModel'
- name: createOneQuietly
visibility: public
parameters:
- name: attributes
default: '[]'
comment: '# * Create a single model and persist it to the database without dispatching
any model events.
# *
# * @param (callable(array<string, mixed>): array<string, mixed>)|array<string,
mixed> $attributes
# * @return TModel'
- name: createMany
visibility: public
parameters:
- name: records
default: 'null'
comment: '# * Create a collection of models and persist them to the database.
# *
# * @param int|null|iterable<int, array<string, mixed>> $records
# * @return \Illuminate\Database\Eloquent\Collection<int, TModel>'
- name: createManyQuietly
visibility: public
parameters:
- name: records
default: 'null'
comment: '# * Create a collection of models and persist them to the database without
dispatching any model events.
# *
# * @param int|null|iterable<int, array<string, mixed>> $records
# * @return \Illuminate\Database\Eloquent\Collection<int, TModel>'
- name: create
visibility: public
parameters:
- name: attributes
default: '[]'
- name: parent
default: 'null'
comment: '# * Create a collection of models and persist them to the database.
# *
# * @param (callable(array<string, mixed>): array<string, mixed>)|array<string,
mixed> $attributes
# * @param \Illuminate\Database\Eloquent\Model|null $parent
# * @return \Illuminate\Database\Eloquent\Collection<int, TModel>|TModel'
- name: createQuietly
visibility: public
parameters:
- name: attributes
default: '[]'
- name: parent
default: 'null'
comment: '# * Create a collection of models and persist them to the database without
dispatching any model events.
# *
# * @param (callable(array<string, mixed>): array<string, mixed>)|array<string,
mixed> $attributes
# * @param \Illuminate\Database\Eloquent\Model|null $parent
# * @return \Illuminate\Database\Eloquent\Collection<int, TModel>|TModel'
- name: lazy
visibility: public
parameters:
- name: attributes
default: '[]'
- name: parent
default: 'null'
comment: '# * Create a callback that persists a model in the database when invoked.
# *
# * @param array<string, mixed> $attributes
# * @param \Illuminate\Database\Eloquent\Model|null $parent
# * @return \Closure(): (\Illuminate\Database\Eloquent\Collection<int, TModel>|TModel)'
- name: store
visibility: protected
parameters:
- name: results
comment: '# * Set the connection name on the results and store them.
# *
# * @param \Illuminate\Support\Collection<int, \Illuminate\Database\Eloquent\Model> $results
# * @return void'
- name: createChildren
visibility: protected
parameters:
- name: model
comment: '# * Create the children for the given model.
# *
# * @param \Illuminate\Database\Eloquent\Model $model
# * @return void'
- name: makeOne
visibility: public
parameters:
- name: attributes
default: '[]'
comment: '# * Make a single instance of the model.
# *
# * @param (callable(array<string, mixed>): array<string, mixed>)|array<string,
mixed> $attributes
# * @return TModel'
- name: make
visibility: public
parameters:
- name: attributes
default: '[]'
- name: parent
default: 'null'
comment: '# * Create a collection of models.
# *
# * @param (callable(array<string, mixed>): array<string, mixed>)|array<string,
mixed> $attributes
# * @param \Illuminate\Database\Eloquent\Model|null $parent
# * @return \Illuminate\Database\Eloquent\Collection<int, TModel>|TModel'
- name: makeInstance
visibility: protected
parameters:
- name: parent
comment: '# * Make an instance of the model with the given attributes.
# *
# * @param \Illuminate\Database\Eloquent\Model|null $parent
# * @return \Illuminate\Database\Eloquent\Model'
- name: getExpandedAttributes
visibility: protected
parameters:
- name: parent
comment: '# * Get a raw attributes array for the model.
# *
# * @param \Illuminate\Database\Eloquent\Model|null $parent
# * @return mixed'
- name: getRawAttributes
visibility: protected
parameters:
- name: parent
comment: '# * Get the raw attributes for the model as an array.
# *
# * @param \Illuminate\Database\Eloquent\Model|null $parent
# * @return array'
- name: parentResolvers
visibility: protected
parameters: []
comment: '# * Create the parent relationship resolvers (as deferred Closures).
# *
# * @return array'
- name: expandAttributes
visibility: protected
parameters:
- name: definition
comment: '# * Expand all attributes to their underlying values.
# *
# * @param array $definition
# * @return array'
- name: state
visibility: public
parameters:
- name: state
comment: '# * Add a new state transformation to the model definition.
# *
# * @param (callable(array<string, mixed>, TModel|null): array<string, mixed>)|array<string,
mixed> $state
# * @return static'
- name: set
visibility: public
parameters:
- name: key
- name: value
comment: '# * Set a single model attribute.
# *
# * @param string|int $key
# * @param mixed $value
# * @return static'
- name: sequence
visibility: public
parameters:
- name: '...$sequence'
comment: '# * Add a new sequenced state transformation to the model definition.
# *
# * @param mixed ...$sequence
# * @return static'
- name: forEachSequence
visibility: public
parameters:
- name: '...$sequence'
comment: '# * Add a new sequenced state transformation to the model definition and
update the pending creation count to the size of the sequence.
# *
# * @param array ...$sequence
# * @return static'
- name: crossJoinSequence
visibility: public
parameters:
- name: '...$sequence'
comment: '# * Add a new cross joined sequenced state transformation to the model
definition.
# *
# * @param array ...$sequence
# * @return static'
- name: has
visibility: public
parameters:
- name: factory
- name: relationship
default: 'null'
comment: '# * Define a child relationship for the model.
# *
# * @param \Illuminate\Database\Eloquent\Factories\Factory $factory
# * @param string|null $relationship
# * @return static'
- name: guessRelationship
visibility: protected
parameters:
- name: related
comment: '# * Attempt to guess the relationship name for a "has" relationship.
# *
# * @param string $related
# * @return string'
- name: hasAttached
visibility: public
parameters:
- name: factory
- name: pivot
default: '[]'
- name: relationship
default: 'null'
comment: '# * Define an attached relationship for the model.
# *
# * @param \Illuminate\Database\Eloquent\Factories\Factory|\Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model|array $factory
# * @param (callable(): array<string, mixed>)|array<string, mixed> $pivot
# * @param string|null $relationship
# * @return static'
- name: for
visibility: public
parameters:
- name: factory
- name: relationship
default: 'null'
comment: '# * Define a parent relationship for the model.
# *
# * @param \Illuminate\Database\Eloquent\Factories\Factory|\Illuminate\Database\Eloquent\Model $factory
# * @param string|null $relationship
# * @return static'
- name: recycle
visibility: public
parameters:
- name: model
comment: '# * Provide model instances to use instead of any nested factory calls
when creating relationships.
# *
# * @param \Illuminate\Database\Eloquent\Model|\Illuminate\Support\Collection|array $model
# * @return static'
- name: getRandomRecycledModel
visibility: public
parameters:
- name: modelClassName
comment: '# * Retrieve a random model of a given type from previously provided models
to recycle.
# *
# * @template TClass of \Illuminate\Database\Eloquent\Model
# *
# * @param class-string<TClass> $modelClassName
# * @return TClass|null'
- name: afterMaking
visibility: public
parameters:
- name: callback
comment: '# * Add a new "after making" callback to the model definition.
# *
# * @param \Closure(TModel): mixed $callback
# * @return static'
- name: afterCreating
visibility: public
parameters:
- name: callback
comment: '# * Add a new "after creating" callback to the model definition.
# *
# * @param \Closure(TModel): mixed $callback
# * @return static'
- name: callAfterMaking
visibility: protected
parameters:
- name: instances
comment: '# * Call the "after making" callbacks for the given model instances.
# *
# * @param \Illuminate\Support\Collection $instances
# * @return void'
- name: callAfterCreating
visibility: protected
parameters:
- name: instances
- name: parent
default: 'null'
comment: '# * Call the "after creating" callbacks for the given model instances.
# *
# * @param \Illuminate\Support\Collection $instances
# * @param \Illuminate\Database\Eloquent\Model|null $parent
# * @return void'
- name: count
visibility: public
parameters:
- name: count
comment: '# * Specify how many models should be generated.
# *
# * @param int|null $count
# * @return static'
- name: connection
visibility: public
parameters:
- name: connection
comment: '# * Specify the database connection that should be used to generate models.
# *
# * @param string $connection
# * @return static'
- name: newInstance
visibility: protected
parameters:
- name: arguments
default: '[]'
comment: '# * Create a new instance of the factory builder with the given mutated
properties.
# *
# * @param array $arguments
# * @return static'
- name: newModel
visibility: public
parameters:
- name: attributes
default: '[]'
comment: '# * Get a new model instance.
# *
# * @param array<string, mixed> $attributes
# * @return TModel'
- name: modelName
visibility: public
parameters: []
comment: '# * Get the name of the model that is generated by the factory.
# *
# * @return class-string<TModel>'
- name: guessModelNamesUsing
visibility: public
parameters:
- name: callback
comment: '# * Specify the callback that should be invoked to guess model names based
on factory names.
# *
# * @param callable(self): class-string<TModel> $callback
# * @return void'
- name: useNamespace
visibility: public
parameters:
- name: namespace
comment: '# * Specify the default namespace that contains the application''s model
factories.
# *
# * @param string $namespace
# * @return void'
- name: factoryForModel
visibility: public
parameters:
- name: modelName
comment: '# * Get a new factory instance for the given model name.
# *
# * @template TClass of \Illuminate\Database\Eloquent\Model
# *
# * @param class-string<TClass> $modelName
# * @return \Illuminate\Database\Eloquent\Factories\Factory<TClass>'
- name: guessFactoryNamesUsing
visibility: public
parameters:
- name: callback
comment: '# * Specify the callback that should be invoked to guess factory names
based on dynamic relationship names.
# *
# * @param callable(class-string<\Illuminate\Database\Eloquent\Model>): class-string<\Illuminate\Database\Eloquent\Factories\Factory> $callback
# * @return void'
- name: withFaker
visibility: protected
parameters: []
comment: '# * Get a new Faker instance.
# *
# * @return \Faker\Generator'
- name: resolveFactoryName
visibility: public
parameters:
- name: modelName
comment: '# * Get the factory name for the given model name.
# *
# * @template TClass of \Illuminate\Database\Eloquent\Model
# *
# * @param class-string<TClass> $modelName
# * @return class-string<\Illuminate\Database\Eloquent\Factories\Factory<TClass>>'
- name: appNamespace
visibility: protected
parameters: []
comment: '# * Get the application namespace for the application.
# *
# * @return string'
- name: __call
visibility: public
parameters:
- name: method
- name: parameters
comment: '# * Proxy dynamic factory methods onto their proper methods.
# *
# * @param string $method
# * @param array $parameters
# * @return mixed'
traits:
- Closure
- Faker\Generator
- Illuminate\Container\Container
- Illuminate\Contracts\Foundation\Application
- Illuminate\Database\Eloquent\Model
- Illuminate\Database\Eloquent\SoftDeletes
- Illuminate\Support\Carbon
- Illuminate\Support\Collection
- Illuminate\Support\Enumerable
- Illuminate\Support\Str
- Illuminate\Support\Traits\Conditionable
- Illuminate\Support\Traits\ForwardsCalls
- Illuminate\Support\Traits\Macroable
- Throwable
interfaces: []