public static function doSelectJoinAll(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     MemberJobI18nPeer::addSelectColumns($c);
     $startcol2 = MemberJobI18nPeer::NUM_COLUMNS - MemberJobI18nPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     MemberJobPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + MemberJobPeer::NUM_COLUMNS;
     $c->addJoin(MemberJobI18nPeer::ID, MemberJobPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = MemberJobI18nPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = MemberJobPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getMemberJob();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addMemberJobI18n($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initMemberJobI18ns();
             $obj2->addMemberJobI18n($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
Exemple #2
0
 public static function doSelectWithI18n(Criteria $c, $culture = null, $con = null)
 {
     if ($culture === null) {
         $culture = sfContext::getInstance()->getUser()->getCulture();
     }
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     MemberJobPeer::addSelectColumns($c);
     $startcol = MemberJobPeer::NUM_COLUMNS - MemberJobPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     MemberJobI18nPeer::addSelectColumns($c);
     $c->addJoin(MemberJobPeer::ID, MemberJobI18nPeer::ID);
     $c->add(MemberJobI18nPeer::CULTURE, $culture);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = MemberJobPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $obj1->setCulture($culture);
         $omClass = MemberJobI18nPeer::getOMClass($rs, $startcol);
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol);
         $obj1->setMemberJobI18nForCulture($obj2, $culture);
         $obj2->setMemberJob($obj1);
         $results[] = $obj1;
     }
     return $results;
 }