Example #1
0
 public function getMemberJobI18ns($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseMemberJobI18nPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collMemberJobI18ns === null) {
         if ($this->isNew()) {
             $this->collMemberJobI18ns = array();
         } else {
             $criteria->add(MemberJobI18nPeer::ID, $this->getId());
             MemberJobI18nPeer::addSelectColumns($criteria);
             $this->collMemberJobI18ns = MemberJobI18nPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(MemberJobI18nPeer::ID, $this->getId());
             MemberJobI18nPeer::addSelectColumns($criteria);
             if (!isset($this->lastMemberJobI18nCriteria) || !$this->lastMemberJobI18nCriteria->equals($criteria)) {
                 $this->collMemberJobI18ns = MemberJobI18nPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastMemberJobI18nCriteria = $criteria;
     return $this->collMemberJobI18ns;
 }
Example #2
0
 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;
 }
Example #3
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;
 }