League\FactoryMuffin\FactoryMuffin::make PHP Метод

make() защищенный Метод

Make an instance of a model.
protected make ( string $name, array $attr, boolean $save ) : object
$name string The model definition name.
$attr array The model attributes.
$save boolean Are we saving, or just creating an instance?
Результат object
    protected function make($name, array $attr, $save)
    {
        $definition = $this->getDefinition($name);
        $model = $this->makeClass($definition->getClass(), $definition->getMaker());
        // Make the object as saved so that other generators persist correctly
        if ($save) {
            $this->store->markPending($model);
        }
        // Get the attribute definitions
        $attributes = array_merge($this->getDefinition($name)->getDefinitions(), $attr);
        // Generate and save each attribute for the model
        $this->generate($model, $attributes);
        return $model;
    }