League\FactoryMuffin\Generators\GeneratorFactory::make PHP 메소드

make() 공개 메소드

Automatically make the generator class we need.
public make ( string | callable $kind, object $model, FactoryMuffin $factoryMuffin ) : League\FactoryMuffin\Generators\GeneratorInterface | null
$kind string | callable The kind of attribute.
$model object The model instance.
$factoryMuffin League\FactoryMuffin\FactoryMuffin The factory muffin instance.
리턴 League\FactoryMuffin\Generators\GeneratorInterface | null
    public function make($kind, $model, FactoryMuffin $factoryMuffin)
    {
        if (is_callable($kind)) {
            return new CallableGenerator($kind, $model, $factoryMuffin);
        }
        if (is_string($kind) && strpos($kind, EntityGenerator::getPrefix()) === 0) {
            return new EntityGenerator($kind, $model, $factoryMuffin);
        }
        if (is_string($kind) && strpos($kind, FactoryGenerator::getPrefix()) === 0) {
            return new FactoryGenerator($kind, $model, $factoryMuffin);
        }
    }
GeneratorFactory