Пример #1
0
 public function save(PropelPDO $con = null)
 {
     if ($this->isDeleted()) {
         throw new PropelException("You cannot save an object that has been deleted.");
     }
     if ($con === null) {
         $con = Propel::getConnection(DocentePeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
     }
     $con->beginTransaction();
     try {
         $affectedRows = $this->doSave($con);
         $con->commit();
         DocentePeer::addInstanceToPool($this);
         return $affectedRows;
     } catch (PropelException $e) {
         $con->rollBack();
         throw $e;
     }
 }
 public static function doSelectJoinAllExceptRelAnioActividad(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     RelAnioActividadDocentePeer::addSelectColumns($c);
     $startcol2 = RelAnioActividadDocentePeer::NUM_COLUMNS - RelAnioActividadDocentePeer::NUM_LAZY_LOAD_COLUMNS;
     DocentePeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (DocentePeer::NUM_COLUMNS - DocentePeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(RelAnioActividadDocentePeer::FK_DOCENTE_ID), array(DocentePeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = RelAnioActividadDocentePeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = RelAnioActividadDocentePeer::getInstanceFromPool($key1))) {
         } else {
             $omClass = RelAnioActividadDocentePeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             RelAnioActividadDocentePeer::addInstanceToPool($obj1, $key1);
         }
         $key2 = DocentePeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = DocentePeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = DocentePeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 DocentePeer::addInstanceToPool($obj2, $key2);
             }
             $obj2->addRelAnioActividadDocente($obj1);
         }
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
Пример #3
0
 public static function doSelectJoinAllExceptPais(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     DocentePeer::addSelectColumns($c);
     $startcol2 = DocentePeer::NUM_COLUMNS - DocentePeer::NUM_LAZY_LOAD_COLUMNS;
     TipodocumentoPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (TipodocumentoPeer::NUM_COLUMNS - TipodocumentoPeer::NUM_LAZY_LOAD_COLUMNS);
     ProvinciaPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + (ProvinciaPeer::NUM_COLUMNS - ProvinciaPeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(DocentePeer::FK_TIPODOCUMENTO_ID), array(TipodocumentoPeer::ID), $join_behavior);
     $c->addJoin(array(DocentePeer::FK_PROVINCIA_ID), array(ProvinciaPeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = DocentePeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = DocentePeer::getInstanceFromPool($key1))) {
         } else {
             $omClass = DocentePeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             DocentePeer::addInstanceToPool($obj1, $key1);
         }
         $key2 = TipodocumentoPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = TipodocumentoPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = TipodocumentoPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 TipodocumentoPeer::addInstanceToPool($obj2, $key2);
             }
             $obj2->addDocente($obj1);
         }
         $key3 = ProvinciaPeer::getPrimaryKeyHashFromRow($row, $startcol3);
         if ($key3 !== null) {
             $obj3 = ProvinciaPeer::getInstanceFromPool($key3);
             if (!$obj3) {
                 $omClass = ProvinciaPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj3 = new $cls();
                 $obj3->hydrate($row, $startcol3);
                 ProvinciaPeer::addInstanceToPool($obj3, $key3);
             }
             $obj3->addDocente($obj1);
         }
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }