public function beforeDelete() { foreach ($this->facturas as $c) { $c->delete(); } return parent::beforeDelete(); }
public static function getArrayLanguage() { if ($this->default) { return false; } return parent::beforeDelete(); }
public function beforeDelete() { foreach ($this->productos as $c) { $c->delete(); } return parent::beforeDelete(); }
function beforeDelete() { parent::beforeDelete(); if ($this->delete_ids) { Group::model()->deleteAll(array('id' => $this->delete_ids)); } return true; }
public function beforeDelete() { if (parent::beforeDelete()) { foreach ($this->data as $data) { $data->delete(); } return true; } return false; }
public function beforeDelete() { // Eliminar todos los codigos arancelarios del producto if (!$this->scenario == 'eliminarproducto') { foreach ($this->findAllByAttributes(array('presupuesto_partida_id' => $this->presupuesto_partida_id, 'producto_id' => $this->producto_id)) as $c) { $c->delete(); } } return parent::beforeDelete(); }
public function beforeDelete() { if (parent::beforeDelete()) { foreach ($this->data as $item) { $item->delete(); } foreach ($this->polygons as $item) { $item->delete(); } return true; } return false; }
/** * Before delete event */ public function beforeDelete() { // Delete all theme files first ThemeFile::model()->deleteAll('theme_id=:id', array(':id' => $this->id)); // Delete theme folder with all files $path = Yii::getPathOfAlias('application.www.themes'); $themeDir = $path . '/' . $this->dirname; if (is_dir($themeDir)) { recursiveDirRemove($themeDir); } return parent::beforeDelete(); }
/** * Before Delete event * */ public function beforeDelete() { foreach ($this->replies as $reply) { $reply->delete(); } foreach ($this->participants as $participant) { $participant->delete(); } foreach ($this->notifications as $notification) { $notification->delete(); } return parent::beforeDelete(); }
public function beforeDelete() { foreach ($this->fieldData as $field) { $field->delete(); } return parent::beforeDelete(); }
public function beforeDelete() { foreach ($this->presupuestoPartidaProyecto as $c) { $c->delete(); } return parent::beforeDelete(); }
/** * Before delete event */ public function beforeDelete() { // Delete all messages first Message::model()->deleteAll('language_id=:id', array(':id' => $this->id)); return parent::beforeDelete(); }
public function beforeDelete() { /* foreach($this->importado as $c) $c->delete();*/ return parent::beforeDelete(); }
protected function beforeDelete() { if(parent::beforeDelete()) { $this->blog->delete(); return true; } else { return false; } }
public function beforeDelete() { Person::model()->loadModel($this->id)->delete(); return parent::beforeDelete(); }
/** * Before delete event */ public function beforeDelete() { return parent::beforeDelete(); }
public function beforeDelete() { if ($this->id == 1 || $this->login == self::ADMIN_LOGIN) { return false; } return parent::beforeDelete(); }
public function beforeDelete() { // Eliminando en cascada todos los productos nacionales correspondientes a esta partida foreach ($this->presupuestoProductos as $c) { if (!$c->delete()) { throw new Exception("No se pudo eliminar el presupuesto_producto con ID: " . $c->presupuesto_id, 1); } } // Eliminando en cascada todos los productos importados correspondientes a esta partida foreach ($this->presupuestoImportacion as $c) { if (!$c->delete()) { throw new Exception("No se pudo eliminar el presupuesto_importacion con ID: " . $c->presupuesto_partida_id, 1); } } // Eliminando las fuentes de financiamientos asociadas a la partida foreach ($this->fuenteFinanciamientos as $c) { if (!$c->delete()) { throw new Exception("No se pudo eliminar la fuente_presupuesto con ID: " . $c->id, 1); } } if (Yii::app()->params['trimestresEsquemas'][Yii::app()->session['trimestreSeleccionado']] != 'public') { // Eliminando los productos y relacionadas a factura asociadas a la partida foreach ($this->facturaProductos as $c) { if (!$c->delete()) { throw new Exception("No se pudo eliminar el facturas_productos con ID: " . $c->id, 1); } } } foreach ($this->presupuestoPartidaProyecto as $c) { $c->setScenario('cascadaPartida'); // Esto para evitar que me intente eliminar despues de borrarse el mismo if (!$c->delete()) { throw new Exception("No se pudo eliminar la relación presupuestoPartidaProyecto con ID: " . $c->presupuesto_partida_id, 1); } } foreach ($this->presupuestoPartidaAcciones as $c) { $c->setScenario('cascadaPartida'); // Esto para evitar que me intente eliminar despues de borrarse el mismo if (!$c->delete()) { throw new Exception("No se pudo eliminar la relación presupuestoPartidaAcciones con ID: " . $c->presupuesto_partida_id, 1); } } return parent::beforeDelete(); }