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