public function executeDelete() { Usuario::usuarioActualPermisos($this, 'sesiones', 'delete', false, sfRequest::GET); $this->sesion = SesionPeer::retrieveByPk($this->getRequestParameter('idsesion')); $this->forward404Unless($this->sesion); try { $this->deleteSesion($this->sesion); $c = new Criteria(); $c->add(SesionLogPeer::ID_SESION, $this->getRequestParameter('idsesion')); SesionLogPeer::doDelete($c); } catch (PropelException $e) { $this->getRequest()->setError('delete', 'Could not delete the selected Sesion. Make sure it does not have any associated items.'); return $this->forward('sesiones', 'list'); } switch ($this->getActionName()) { case 'create': break; case 'edit': break; } return $this->redirect('sesiones/list'); }
/** * Removes this object from datastore and sets delete attribute. * * @param PropelPDO $con * @return void * @throws PropelException * @see BaseObject::setDeleted() * @see BaseObject::isDeleted() */ public function delete(PropelPDO $con = null) { foreach (sfMixer::getCallables('BaseSesionLog:delete:pre') as $callable) { $ret = call_user_func($callable, $this, $con); if ($ret) { return; } } if ($this->isDeleted()) { throw new PropelException("This object has already been deleted."); } if ($con === null) { $con = Propel::getConnection(SesionLogPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); } $con->beginTransaction(); try { SesionLogPeer::doDelete($this, $con); $this->setDeleted(true); $con->commit(); } catch (PropelException $e) { $con->rollBack(); throw $e; } foreach (sfMixer::getCallables('BaseSesionLog:delete:post') as $callable) { call_user_func($callable, $this, $con); } }