Beispiel #1
0
 public static function doSelectJoinAllExceptProvincia(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     LocacionPeer::addSelectColumns($c);
     $startcol2 = LocacionPeer::NUM_COLUMNS - LocacionPeer::NUM_LAZY_LOAD_COLUMNS;
     TipolocacionPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (TipolocacionPeer::NUM_COLUMNS - TipolocacionPeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(LocacionPeer::FK_TIPOLOCACION_ID), array(TipolocacionPeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = LocacionPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = LocacionPeer::getInstanceFromPool($key1))) {
         } else {
             $omClass = LocacionPeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             LocacionPeer::addInstanceToPool($obj1, $key1);
         }
         $key2 = TipolocacionPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = TipolocacionPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = TipolocacionPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 TipolocacionPeer::addInstanceToPool($obj2, $key2);
             }
             $obj2->addLocacion($obj1);
         }
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
 public static function populateObjects(PDOStatement $stmt)
 {
     $results = array();
     $cls = TipolocacionPeer::getOMClass();
     $cls = substr('.' . $cls, strrpos('.' . $cls, '.') + 1);
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key = TipolocacionPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj = TipolocacionPeer::getInstanceFromPool($key))) {
             $results[] = $obj;
         } else {
             $obj = new $cls();
             $obj->hydrate($row);
             $results[] = $obj;
             TipolocacionPeer::addInstanceToPool($obj, $key);
         }
     }
     $stmt->closeCursor();
     return $results;
 }