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
파일 보기 프로젝트 열기: yiisoft/yii2 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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