Beispiel #1
0
 public static function doDelete($values, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(RegionPeer::DATABASE_NAME);
     }
     if ($values instanceof Criteria) {
         $criteria = clone $values;
     } elseif ($values instanceof Region) {
         $criteria = $values->buildPkeyCriteria();
     } else {
         $criteria = new Criteria(self::DATABASE_NAME);
         $criteria->add(RegionPeer::ID, (array) $values, Criteria::IN);
     }
     $criteria->setDbName(self::DATABASE_NAME);
     $affectedRows = 0;
     try {
         $con->begin();
         $affectedRows += RegionPeer::doOnDeleteCascade($criteria, $con);
         $affectedRows += BasePeer::doDelete($criteria, $con);
         $con->commit();
         return $affectedRows;
     } catch (PropelException $e) {
         $con->rollback();
         throw $e;
     }
 }