Пример #1
0
 public function delete($con = null)
 {
     if ($this->isDeleted()) {
         throw new PropelException("This object has already been deleted.");
     }
     if ($con === null) {
         $con = Propel::getConnection(ClassAgendaFilePeer::DATABASE_NAME);
     }
     try {
         $con->begin();
         ClassAgendaFilePeer::doDelete($this, $con);
         $this->setDeleted(true);
         $con->commit();
     } catch (PropelException $e) {
         $con->rollback();
         throw $e;
     }
 }
Пример #2
0
 protected static function doOnDeleteCascade(Criteria $criteria, Connection $con)
 {
     $affectedRows = 0;
     $objects = ClassAgendaPeer::doSelect($criteria, $con);
     foreach ($objects as $obj) {
         include_once 'lib/model/ClassAgendaFile.php';
         $c = new Criteria();
         $c->add(ClassAgendaFilePeer::CLASS_AGENDA_ID, $obj->getId());
         $affectedRows += ClassAgendaFilePeer::doDelete($c, $con);
     }
     return $affectedRows;
 }