Example #1
0
 public function saveDocenteHorarioList($con = null)
 {
     if (!$this->isValid()) {
         throw $this->getErrorSchema();
     }
     if (!isset($this->widgetSchema['docente_horario_list'])) {
         // somebody has unset this widget
         return;
     }
     if (is_null($con)) {
         $con = $this->getConnection();
     }
     $c = new Criteria();
     $c->add(DocenteHorarioPeer::FK_DOCENTE_ID, $this->object->getPrimaryKey());
     DocenteHorarioPeer::doDelete($c, $con);
     $values = $this->getValue('docente_horario_list');
     if (is_array($values)) {
         foreach ($values as $value) {
             $obj = new DocenteHorario();
             $obj->setFkDocenteId($this->object->getPrimaryKey());
             $obj->setFkEventoId($value);
             $obj->save();
         }
     }
 }
Example #2
0
 public function delete(PropelPDO $con = null)
 {
     if ($this->isDeleted()) {
         throw new PropelException("This object has already been deleted.");
     }
     if ($con === null) {
         $con = Propel::getConnection(DocenteHorarioPeer::DATABASE_NAME);
     }
     try {
         $con->beginTransaction();
         $evento = EventoPeer::retrieveByPk($this->getFkEventoId());
         $evento->delete();
         DocenteHorarioPeer::doDelete($this, $con);
         $this->setDeleted(true);
         $con->commit();
     } catch (PropelException $e) {
         $con->rollBack();
         throw $e;
     }
 }
Example #3
0
 public function delete(PropelPDO $con = null)
 {
     if ($this->isDeleted()) {
         throw new PropelException("This object has already been deleted.");
     }
     if ($con === null) {
         $con = Propel::getConnection(DocenteHorarioPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
     }
     $con->beginTransaction();
     try {
         DocenteHorarioPeer::doDelete($this, $con);
         $this->setDeleted(true);
         $con->commit();
     } catch (PropelException $e) {
         $con->rollBack();
         throw $e;
     }
 }