Property | Type | Description | |
---|---|---|---|
$factory | The generator factory instance. | ||
$store | League\FactoryMuffin\Stores\StoreInterface | The store instance. |
Method | Description | |
---|---|---|
__construct ( League\FactoryMuffin\Stores\StoreInterface $store = null, |
Create a new factory muffin instance. | |
camelize ( string $str ) : string | Camelize string. | |
create ( string $name, array $attr = [] ) : object | Creates and saves a model. | |
define ( string $name ) : League\FactoryMuffin\Definition | Define a new model definition. | |
deleteSaved ( ) : |
Delete all the saved models. | |
getDefinition ( string $name ) : League\FactoryMuffin\Definition | Get a model definition. | |
getDefinitions ( ) : League\FactoryMuffin\Definition[] | Get all defined model definitions. | |
instance ( string $name, array $attr = [] ) : object | Return an instance of the model. | |
isPendingOrSaved ( object $model ) : boolean | Is the object saved or will be saved? | |
loadFactories ( string | string[] $paths ) : |
Load the specified factories. | |
seed ( integer $times, string $name, array $attr = [] ) : object[] | Creates and saves multiple versions of a model. |
Method | Description | |
---|---|---|
generate ( object $model, array $attr = [] ) : void | Generate and set the model attributes. | |
make ( string $name, array $attr, boolean $save ) : object | Make an instance of a model. | |
makeClass ( string $class, callable $maker = null ) : object | Make an instance of a class. | |
triggerCallback ( object $model, string $name ) : boolean | Trigger the callback if we have one. |
Method | Description | |
---|---|---|
loadDirectory ( string $path ) : void | Load all the files in a directory. |
public __construct ( League\FactoryMuffin\Stores\StoreInterface $store = null, |
||
$store | League\FactoryMuffin\Stores\StoreInterface | The store instance. |
$factory | The generator factory instance. | |
return | void |
public deleteSaved ( ) : |
||
return |
public getDefinition ( string $name ) : League\FactoryMuffin\Definition | ||
$name | string | The model definition name. |
return | League\FactoryMuffin\Definition |
public getDefinitions ( ) : League\FactoryMuffin\Definition[] | ||
return | League\FactoryMuffin\Definition[] |
public isPendingOrSaved ( object $model ) : boolean | ||
$model | object | The model instance. |
return | boolean |
public loadFactories ( string | string[] $paths ) : |
||
$paths | string | string[] | The directory path(s) to load. |
return |
protected GeneratorFactory,League\FactoryMuffin\Generators $factory | ||
return |