Example #1
0
 function run()
 {
     $this->table =& Table::getInstance('fields');
     $this->index = 'showRows';
     $this->registerAction('new', 'edit');
     parent::run();
 }
Example #2
0
 function run()
 {
     $this->table =& Table::getInstance('groups');
     $this->index = 'showRows';
     $this->registerAction('new', 'edit');
     $this->authAdmin();
     @parent::run();
 }
Example #3
0
 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']));
 }
Example #4
0
 /**
  * @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]);
         }
     }
 }