public function __construct($action = null, $format = null) { $nodetypes = new NodetypeCollection(); $nodetypes->orderBy('sort'); foreach ($nodetypes as $type) { $this->_modelPermissions['Node types'][$type->name] = ['model' => 'node', 'extra' => $type->id]; } Ajde_Event::trigger($this, 'initAclTypes'); parent::__construct($action, $format); }
public function filterByNodetypeCategory($category, $operator = Ajde_Query::OP_AND) { $nodetypes = new NodetypeCollection(); $nodetypes->addFilter(new Ajde_Filter_Where('category', Ajde_Filter::FILTER_EQUALS, $category)); $ids = []; foreach ($nodetypes as $nodetype) { $ids[] = $nodetype->id; } $this->addFilter(new Ajde_Filter_Where('nodetype', Ajde_Filter_Where::FILTER_IN, new Ajde_Db_Function('(' . implode(',', $ids) . ')'), $operator)); }