PHP Class Fakerino\Core\FakeDataFactory

Author: Nicola Pietroluongo ([email protected])
Inheritance: implements Fakerino\Core\FakeDataFactoryInterface
Afficher le fichier Open project: fakerino/fakerino Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( Fakerino\Core\FakeHandler\HandlerInterface $fakeHandler, Fakerino\Core\Database\DbInterface $db, Fakerino\Core\Template\TemplateInterface $template ) It receives: the handlers priority for the fake request, the DbInterface for the fakeTable operation, and the TemplateInterface for the fakeTemplate operation.
__toString ( ) : string
fake ( string | array | null $elementName = null ) : FakeDataFactory Setups the fake element and initializes the output.
fakeEntity ( object | null $entity = null ) : boolean Fills the given entity with fake data.
fakeTable ( string | null $tableName = null ) : array Fills the given table with fake data.
fakeTemplate ( string $file ) : string Fakes a template file.
num ( integer $num = 1 ) : FakeDataFactory Sets $num for iterate the fake process.
seed ( integer | null $seed = null ) : FakeDataFactory
toArray ( ) : array
toJson ( ) : string

Private Methods

Méthode Description
arrayToString ( $arr )
getElementToFake ( $elementsName )
startFake ( $elementName, $num )

Method Details

__construct() public méthode

It receives: the handlers priority for the fake request, the DbInterface for the fakeTable operation, and the TemplateInterface for the fakeTemplate operation.
public __construct ( Fakerino\Core\FakeHandler\HandlerInterface $fakeHandler, Fakerino\Core\Database\DbInterface $db, Fakerino\Core\Template\TemplateInterface $template )
$fakeHandler Fakerino\Core\FakeHandler\HandlerInterface
$db Fakerino\Core\Database\DbInterface
$template Fakerino\Core\Template\TemplateInterface

__toString() public méthode

public __toString ( ) : string
Résultat string

fake() public méthode

Setups the fake element and initializes the output.
public fake ( string | array | null $elementName = null ) : FakeDataFactory
$elementName string | array | null
Résultat FakeDataFactory $this

fakeEntity() public méthode

Fills the given entity with fake data.
public fakeEntity ( object | null $entity = null ) : boolean
$entity object | null
Résultat boolean

fakeTable() public méthode

Fills the given table with fake data.
public fakeTable ( string | null $tableName = null ) : array
$tableName string | null
Résultat array $rows

fakeTemplate() public méthode

Fakes a template file.
public fakeTemplate ( string $file ) : string
$file string
Résultat string

num() public méthode

Sets $num for iterate the fake process.
public num ( integer $num = 1 ) : FakeDataFactory
$num integer
Résultat FakeDataFactory $this

seed() public méthode

public seed ( integer | null $seed = null ) : FakeDataFactory
$seed integer | null
Résultat FakeDataFactory $this

toArray() public méthode

public toArray ( ) : array
Résultat array

toJson() public méthode

public toJson ( ) : string
Résultat string json