Class FactoryLocator
array<callableCake\Datasource\Locator\LocatorInterface>A list of model factory functions.
Register a callable to generate repositories of a given type.
Drop a model factory.
Get the factory for the specified repository type.
add(string $type, Cake\Datasource\Locator\LocatorInterface|callable $factory): void
Register a callable to generate repositories of a given type.
string $type The name of the repository type the factory function is for.
Cake\Datasource\Locator\LocatorInterface|callable $factory The factory function used to create instances.
voiddrop(string $type): void
Drop a model factory.
string $type The name of the repository type to drop the factory for.
voidget(string $type): Cake\Datasource\Locator\LocatorInterface|callable
Get the factory for the specified repository type.
string $type The repository type to get the factory for.
Cake\Datasource\Locator\LocatorInterface|callableInvalidArgumentExceptionA list of model factory functions.
array<callableCake\Datasource\Locator\LocatorInterface>
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.4/class-Cake.Datasource.FactoryLocator.html