function run() { $this->table =& Table::getInstance('fields'); $this->index = 'showRows'; $this->registerAction('new', 'edit'); parent::run(); }
function run() { $this->table =& Table::getInstance('groups'); $this->index = 'showRows'; $this->registerAction('new', 'edit'); $this->authAdmin(); @parent::run(); }
protected function __findTable($name) { foreach ($this->listTables() as $table) { if ($table->TABLE_NAME == $name) { return Table::getInstance($name); } } throw new \RuntimeException(sprintf('Table "%s" could not be found in schema "%s"', $name, $this->params['name'])); }
/** * @param mixed $data * @return int|void */ public function deleteOne($data) { $table = Table::getInstance(); $tree = $table->buildTree($data['id']); if (!isset($tree[0]['children'])) { parent::deleteOne($data); } else { $allSubCategories = $this->treeToArray($tree); foreach ($allSubCategories as $categoryId) { parent::deleteOne(['id' => $categoryId]); } } }