Пример #1
0
 public function getRelAlumnoDivisions($criteria = null, PropelPDO $con = null)
 {
     if ($criteria === null) {
         $criteria = new Criteria(AlumnoPeer::DATABASE_NAME);
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collRelAlumnoDivisions === null) {
         if ($this->isNew()) {
             $this->collRelAlumnoDivisions = array();
         } else {
             $criteria->add(RelAlumnoDivisionPeer::FK_ALUMNO_ID, $this->id);
             RelAlumnoDivisionPeer::addSelectColumns($criteria);
             $this->collRelAlumnoDivisions = RelAlumnoDivisionPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(RelAlumnoDivisionPeer::FK_ALUMNO_ID, $this->id);
             RelAlumnoDivisionPeer::addSelectColumns($criteria);
             if (!isset($this->lastRelAlumnoDivisionCriteria) || !$this->lastRelAlumnoDivisionCriteria->equals($criteria)) {
                 $this->collRelAlumnoDivisions = RelAlumnoDivisionPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastRelAlumnoDivisionCriteria = $criteria;
     return $this->collRelAlumnoDivisions;
 }
Пример #2
0
 public static function doSelectJoinAllExceptAlumno(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     RelAlumnoDivisionPeer::addSelectColumns($c);
     $startcol2 = RelAlumnoDivisionPeer::NUM_COLUMNS - RelAlumnoDivisionPeer::NUM_LAZY_LOAD_COLUMNS;
     DivisionPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (DivisionPeer::NUM_COLUMNS - DivisionPeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(RelAlumnoDivisionPeer::FK_DIVISION_ID), array(DivisionPeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = RelAlumnoDivisionPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = RelAlumnoDivisionPeer::getInstanceFromPool($key1))) {
         } else {
             $omClass = RelAlumnoDivisionPeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             RelAlumnoDivisionPeer::addInstanceToPool($obj1, $key1);
         }
         $key2 = DivisionPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = DivisionPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = DivisionPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 DivisionPeer::addInstanceToPool($obj2, $key2);
             }
             $obj2->addRelAlumnoDivision($obj1);
         }
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }