yii\test\ActiveFixture::load PHP Method

load() public method

The default implementation will first clean up the table by calling ActiveFixture::resetTable. It will then populate the table with the data returned by ActiveFixture::getData. If you override this method, you should consider calling the parent implementation so that the data returned by ActiveFixture::getData can be populated into the table.
public load ( )
    public function load()
    {
        $this->resetTable();
        $this->data = [];
        $table = $this->getTableSchema();
        foreach ($this->getData() as $alias => $row) {
            $primaryKeys = $this->db->schema->insert($table->fullName, $row);
            $this->data[$alias] = array_merge($row, $primaryKeys);
        }
    }

Usage Example

示例#1
0
 public function load()
 {
     parent::load();
     $installer = Yii::$app->rbacInstaller;
     $installer->assign();
 }