PHP Класс 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.
Автор: Graham Campbell ([email protected])
Автор: Scott Robertson ([email protected])
Автор: Michael Bodnarchuk ([email protected])
Наследование: implements League\FactoryMuffin\Generators\GeneratorInterface, implements League\FactoryMuffin\Generators\PrefixInterface
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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.

Приватные методы

Метод Описание
factory ( string $name ) : object Create an instance of the model.

Описание методов

__construct() публичный Метод

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.
Результат void

generate() публичный Метод

The value returned is the id of the generated model, if applicable.
public generate ( ) : object
Результат object

getPrefix() публичный статический Метод

Get the generator prefix.
public static getPrefix ( ) : string
Результат string