예제 #1
0
 public static function doSelectJoinAllExceptTipoiva(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     OrganizacionPeer::addSelectColumns($c);
     $startcol2 = OrganizacionPeer::NUM_COLUMNS - OrganizacionPeer::NUM_LAZY_LOAD_COLUMNS;
     ProvinciaPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (ProvinciaPeer::NUM_COLUMNS - ProvinciaPeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(OrganizacionPeer::FK_PROVINCIA_ID), array(ProvinciaPeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = OrganizacionPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = OrganizacionPeer::getInstanceFromPool($key1))) {
         } else {
             $omClass = OrganizacionPeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             OrganizacionPeer::addInstanceToPool($obj1, $key1);
         }
         $key2 = ProvinciaPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = ProvinciaPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = ProvinciaPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 ProvinciaPeer::addInstanceToPool($obj2, $key2);
             }
             $obj2->addOrganizacion($obj1);
         }
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
예제 #2
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);
     }
     EstablecimientoPeer::addSelectColumns($c);
     $startcol2 = EstablecimientoPeer::NUM_COLUMNS - EstablecimientoPeer::NUM_LAZY_LOAD_COLUMNS;
     DistritoescolarPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (DistritoescolarPeer::NUM_COLUMNS - DistritoescolarPeer::NUM_LAZY_LOAD_COLUMNS);
     OrganizacionPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + (OrganizacionPeer::NUM_COLUMNS - OrganizacionPeer::NUM_LAZY_LOAD_COLUMNS);
     NiveltipoPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + (NiveltipoPeer::NUM_COLUMNS - NiveltipoPeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(EstablecimientoPeer::FK_DISTRITOESCOLAR_ID), array(DistritoescolarPeer::ID), $join_behavior);
     $c->addJoin(array(EstablecimientoPeer::FK_ORGANIZACION_ID), array(OrganizacionPeer::ID), $join_behavior);
     $c->addJoin(array(EstablecimientoPeer::FK_NIVELTIPO_ID), array(NiveltipoPeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = EstablecimientoPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = EstablecimientoPeer::getInstanceFromPool($key1))) {
         } else {
             $omClass = EstablecimientoPeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             EstablecimientoPeer::addInstanceToPool($obj1, $key1);
         }
         $key2 = DistritoescolarPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = DistritoescolarPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = DistritoescolarPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 DistritoescolarPeer::addInstanceToPool($obj2, $key2);
             }
             $obj2->addEstablecimiento($obj1);
         }
         $key3 = OrganizacionPeer::getPrimaryKeyHashFromRow($row, $startcol3);
         if ($key3 !== null) {
             $obj3 = OrganizacionPeer::getInstanceFromPool($key3);
             if (!$obj3) {
                 $omClass = OrganizacionPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj3 = new $cls();
                 $obj3->hydrate($row, $startcol3);
                 OrganizacionPeer::addInstanceToPool($obj3, $key3);
             }
             $obj3->addEstablecimiento($obj1);
         }
         $key4 = NiveltipoPeer::getPrimaryKeyHashFromRow($row, $startcol4);
         if ($key4 !== null) {
             $obj4 = NiveltipoPeer::getInstanceFromPool($key4);
             if (!$obj4) {
                 $omClass = NiveltipoPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj4 = new $cls();
                 $obj4->hydrate($row, $startcol4);
                 NiveltipoPeer::addInstanceToPool($obj4, $key4);
             }
             $obj4->addEstablecimiento($obj1);
         }
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }