PHP Класс Fakerino\Core\FakeDataFactory

Автор: Nicola Pietroluongo ([email protected])
Наследование: implements Fakerino\Core\FakeDataFactoryInterface
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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

Приватные методы

Метод Описание
arrayToString ( $arr )
getElementToFake ( $elementsName )
startFake ( $elementName, $num )

Описание методов

__construct() публичный Метод

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 __toString ( ) : string
Результат string

fake() публичный Метод

Setups the fake element and initializes the output.
public fake ( string | array | null $elementName = null ) : FakeDataFactory
$elementName string | array | null
Результат FakeDataFactory $this

fakeEntity() публичный Метод

Fills the given entity with fake data.
public fakeEntity ( object | null $entity = null ) : boolean
$entity object | null
Результат boolean

fakeTable() публичный Метод

Fills the given table with fake data.
public fakeTable ( string | null $tableName = null ) : array
$tableName string | null
Результат array $rows

fakeTemplate() публичный Метод

Fakes a template file.
public fakeTemplate ( string $file ) : string
$file string
Результат string

num() публичный Метод

Sets $num for iterate the fake process.
public num ( integer $num = 1 ) : FakeDataFactory
$num integer
Результат FakeDataFactory $this

seed() публичный Метод

public seed ( integer | null $seed = null ) : FakeDataFactory
$seed integer | null
Результат FakeDataFactory $this

toArray() публичный Метод

public toArray ( ) : array
Результат array

toJson() публичный Метод

public toJson ( ) : string
Результат string json