Esempio n. 1
0
 public static function retrieveByPK($pk, PropelPDO $con = null)
 {
     if (null !== ($obj = LegajocategoriaPeer::getInstanceFromPool((string) $pk))) {
         return $obj;
     }
     if ($con === null) {
         $con = Propel::getConnection(LegajocategoriaPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $criteria = new Criteria(LegajocategoriaPeer::DATABASE_NAME);
     $criteria->add(LegajocategoriaPeer::ID, $pk);
     $v = LegajocategoriaPeer::doSelect($criteria, $con);
     return !empty($v) > 0 ? $v[0] : null;
 }
 public static function doSelectJoinAllExceptUsuario(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     LegajopedagogicoPeer::addSelectColumns($c);
     $startcol2 = LegajopedagogicoPeer::NUM_COLUMNS - LegajopedagogicoPeer::NUM_LAZY_LOAD_COLUMNS;
     AlumnoPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (AlumnoPeer::NUM_COLUMNS - AlumnoPeer::NUM_LAZY_LOAD_COLUMNS);
     LegajocategoriaPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + (LegajocategoriaPeer::NUM_COLUMNS - LegajocategoriaPeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(LegajopedagogicoPeer::FK_ALUMNO_ID), array(AlumnoPeer::ID), $join_behavior);
     $c->addJoin(array(LegajopedagogicoPeer::FK_LEGAJOCATEGORIA_ID), array(LegajocategoriaPeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = LegajopedagogicoPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = LegajopedagogicoPeer::getInstanceFromPool($key1))) {
         } else {
             $omClass = LegajopedagogicoPeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             LegajopedagogicoPeer::addInstanceToPool($obj1, $key1);
         }
         $key2 = AlumnoPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = AlumnoPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = AlumnoPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 AlumnoPeer::addInstanceToPool($obj2, $key2);
             }
             $obj2->addLegajopedagogico($obj1);
         }
         $key3 = LegajocategoriaPeer::getPrimaryKeyHashFromRow($row, $startcol3);
         if ($key3 !== null) {
             $obj3 = LegajocategoriaPeer::getInstanceFromPool($key3);
             if (!$obj3) {
                 $omClass = LegajocategoriaPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj3 = new $cls();
                 $obj3->hydrate($row, $startcol3);
                 LegajocategoriaPeer::addInstanceToPool($obj3, $key3);
             }
             $obj3->addLegajopedagogico($obj1);
         }
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }