yii\test\ActiveFixture::init PHP Method

init() public method

public init ( )
    public function init()
    {
        parent::init();
        if ($this->modelClass === null && $this->tableName === null) {
            throw new InvalidConfigException('Either "modelClass" or "tableName" must be set.');
        }
    }

Usage Example

 /**
  * @throws \yii\base\InvalidConfigException
  */
 public function init()
 {
     parent::init();
     $this->dataFile = __DIR__ . '/data/records.php';
 }