Ejemplo n.º 1
0
 protected function _entryDelete($entryId)
 {
     $this->_iaCore->startHook('phpAdminBeforePlanDelete', array('entryId' => $entryId));
     $result = parent::_entryDelete($entryId);
     if ($result) {
         // here we should drop the "for_plan" column of fields
         // if there are no more plans exist
         if (0 === (int) $this->_iaDb->one(iaDb::STMT_COUNT_ROWS)) {
             $this->_iaDb->update(array('for_plan' => 0), iaDb::convertIds(1, 'for_plan'), null, iaField::getTable());
         }
         iaLanguage::delete(self::PATTERN_TITLE . $entryId);
         iaLanguage::delete(self::PATTERN_DESCRIPTION . $entryId);
     }
     return $result;
 }
Ejemplo n.º 2
0
 public function deleteUsergroup($entryId)
 {
     $this->iaDb->setTable(iaUsers::getUsergroupsTable());
     $usergroup = $this->iaDb->row(iaDb::ALL_COLUMNS_SELECTION, iaDb::convertIds($entryId));
     $result = $this->iaDb->delete(iaDb::convertIds($entryId));
     if ($result) {
         // delete language records
         iaLanguage::delete('usergroup_' . $usergroup['name']);
         $this->iaDb->delete('`type` = :type AND `type_id` = :id', 'acl_privileges', array('type' => 'group', 'id' => $entryId));
         // TODO: use the class method for this
         $this->iaDb->update(array('usergroup_id' => iaUsers::MEMBERSHIP_REGULAR), iaDb::convertIds((int) $entryId, 'usergroup_id'), null, iaUsers::getTable());
     }
     $this->iaDb->resetTable();
     return $result;
 }