PHP Класс yii\test\BaseActiveFixture

For more details and usage information on BaseActiveFixture, see the guide article on fixtures.
С версии: 2.0
Автор: Qiang Xue ([email protected])
Наследование: extends DbFixture, implements IteratorAggregate, implements ArrayAccess, implements Countable, use trait yii\base\ArrayAccessTrait
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$data the data rows. Each array element represents one row of data (column name => column value).
$dataFile the file path or path alias of the data file that contains the fixture data to be returned by BaseActiveFixture::getData. You can set this property to be false to prevent loading any data.
$modelClass the AR model class associated with this fixture.

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

Метод Описание
getModel ( string $name ) : null | ActiveRecord Returns the AR model by the specified model name.
load ( ) Loads the fixture.
unload ( )

Защищенные методы

Метод Описание
getData ( ) : array Returns the fixture data.

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

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

The default implementation will try to return the fixture data by including the external file specified by [[dataFile]]. The file should return the data array that will be stored in [[data]] after inserting into the database.
protected getData ( ) : array
Результат array the data to be put into the database

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

A model name is the key of the corresponding data row in [[data]].
public getModel ( string $name ) : null | ActiveRecord
$name string the model name.
Результат null | yii\db\ActiveRecord the AR model, or null if the model cannot be found in the database

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

The default implementation simply stores the data returned by BaseActiveFixture::getData in [[data]]. You should usually override this method by putting the data into the underlying database.
public load ( )

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

public unload ( )

Описание свойств

$data публичное свойство

the data rows. Each array element represents one row of data (column name => column value).
public $data

$dataFile публичное свойство

the file path or path alias of the data file that contains the fixture data to be returned by BaseActiveFixture::getData. You can set this property to be false to prevent loading any data.
public $dataFile

$modelClass публичное свойство

the AR model class associated with this fixture.
public $modelClass