Beispiel #1
0
 /**
  * delete с учётом удаления таблицы с публикациями
  *
  * @param  array|string $where SQL WHERE clause(s).
  * @return int          The number of rows deleted.
  */
 public function delete($where)
 {
     $resultSet = $this->fetchAll($where);
     if (sizeof($resultSet)) {
         foreach ($resultSet as $row) {
             $_migrationManager = new Modules_Dbmigrations_Framework_Manager();
             $_migrationManager->downTo('Modules_Publications_Migrations_CreatePublicationAbstractTable', $row->table_name);
         }
     }
     return parent::delete($where);
 }
Beispiel #2
0
 /**
  * delete с учётом удаления поля из таблицы публикаций
  *
  * @param  array|string $where SQL WHERE clause(s).
  * @return int          The number of rows deleted.
  */
 public function delete($where)
 {
     $resultSet = $this->fetchAll($where);
     if (sizeof($resultSet)) {
         $modelList = new Modules_Publications_Model_List();
         foreach ($resultSet as $row) {
             $tableInfo = $modelList->fetchRow($modelList->select()->where('rubric_id = ?', $row->rubric_id));
             $tableName = $tableInfo->table_name;
             $filedName = $row->name;
             $_migrationManager = new Modules_Dbmigrations_Framework_Manager();
             $_migrationManager->downTo('Modules_Publications_Migrations_CreatePublicationAbstractFieled', array($tableName, $filedName));
         }
     }
     return parent::delete($where);
 }