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