PHP Class League\FactoryMuffin\Generators\EntityGenerator

The entity generator can be useful for setting up relationships between models. The entity generator will create and return the generated model.
Author: Graham Campbell ([email protected])
Author: Scott Robertson ([email protected])
Author: Michael Bodnarchuk ([email protected])
Inheritance: implements League\FactoryMuffin\Generators\GeneratorInterface, implements League\FactoryMuffin\Generators\PrefixInterface
Datei anzeigen Open project: zizaco/factory-muff Class Usage Examples

Public Methods

Method Description
__construct ( string $kind, object $model, FactoryMuffin $factoryMuffin ) : void Create a new factory generator instance.
generate ( ) : object Generate, and return the attribute.
getPrefix ( ) : string Get the generator prefix.

Private Methods

Method Description
factory ( string $name ) : object Create an instance of the model.

Method Details

__construct() public method

Create a new factory generator instance.
public __construct ( string $kind, object $model, FactoryMuffin $factoryMuffin ) : void
$kind string The kind of attribute.
$model object The model instance.
$factoryMuffin League\FactoryMuffin\FactoryMuffin The factory muffin instance.
return void

generate() public method

The value returned is the id of the generated model, if applicable.
public generate ( ) : object
return object

getPrefix() public static method

Get the generator prefix.
public static getPrefix ( ) : string
return string