Class FactoryLocator
Properties summary
- A list of model factory functions.
callable[]
Method Summary
- Register a callable to generate repositories of a given type.
- Drop a model factory.
- Get the factory for the specified repository type.
Method Detail
add()source public static
add( string $type , callable $factory )
Register a callable to generate repositories of a given type.
Parameters
- string
$type
- The name of the repository type the factory function is for.
- callable
$factory
- The factory function used to create instances.
drop()source public static
drop( string $type )
Drop a model factory.
Parameters
- string
$type
- The name of the repository type to drop the factory for.
get()source public static
get( string $type )
Get the factory for the specified repository type.
Parameters
- string
$type
- The repository type to get the factory for.
Returns
callableThe factory for the repository type.
Throws
InvalidArgumentExceptionIf the specified repository type has no factory.
Properties detail
© 2005–2017 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/3.4/class-Cake.Datasource.FactoryLocator.html