atk4\data\tests\Folder::init PHP Method

init() public method

public init ( )
    public function init()
    {
        parent::init();
        $this->addField('name');
        $this->hasMany('SubFolder', [new self(), 'their_field' => 'parent_id'])->addField('count', ['aggregate' => 'count', 'field' => $this->expr('*')]);
        $this->hasOne('parent_id', new self())->addTitle();
        $this->addField('is_deleted', ['type' => 'boolean']);
        $this->addCondition('is_deleted', false);
    }
Folder