Ejemplo n.º 1
0
 protected static function doOnDeleteCascade(Criteria $criteria, Connection $con)
 {
     $affectedRows = 0;
     $objects = WriterPeer::doSelect($criteria, $con);
     foreach ($objects as $obj) {
         include_once 'lib/model/CatalogWriter.php';
         $c = new Criteria();
         $c->add(CatalogWriterPeer::WRITER_ID, $obj->getId());
         $affectedRows += CatalogWriterPeer::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(CatalogWriterPeer::DATABASE_NAME);
     }
     try {
         $con->begin();
         CatalogWriterPeer::doDelete($this, $con);
         $this->setDeleted(true);
         $con->commit();
     } catch (PropelException $e) {
         $con->rollback();
         throw $e;
     }
 }