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