프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$factory | The generator factory instance. | ||
$store | League\FactoryMuffin\Stores\StoreInterface | The store instance. |
메소드 | 설명 | |
---|---|---|
__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. |
메소드 | 설명 | |
---|---|---|
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. |
메소드 | 설명 | |
---|---|---|
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. | |
리턴 | void |
public deleteSaved ( ) : |
||
리턴 |
public getDefinition ( string $name ) : League\FactoryMuffin\Definition | ||
$name | string | The model definition name. |
리턴 | League\FactoryMuffin\Definition |
public getDefinitions ( ) : League\FactoryMuffin\Definition[] | ||
리턴 | League\FactoryMuffin\Definition[] |
public isPendingOrSaved ( object $model ) : boolean | ||
$model | object | The model instance. |
리턴 | boolean |
public loadFactories ( string | string[] $paths ) : |
||
$paths | string | string[] | The directory path(s) to load. |
리턴 |
protected GeneratorFactory,League\FactoryMuffin\Generators $factory | ||
리턴 |