public static function doSelectJoinAllExceptUser(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     UserchapterregionPeer::addSelectColumns($c);
     $startcol2 = UserchapterregionPeer::NUM_COLUMNS - UserchapterregionPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     ChapterregionPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + ChapterregionPeer::NUM_COLUMNS;
     $c->addJoin(UserchapterregionPeer::CHAPTERREGION_ID, ChapterregionPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = UserchapterregionPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = ChapterregionPeer::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->getChapterregion();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addUserchapterregion($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initUserchapterregions();
             $obj2->addUserchapterregion($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
Пример #2
0
 public function getChapterregions($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseChapterregionPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collChapterregions === null) {
         if ($this->isNew()) {
             $this->collChapterregions = array();
         } else {
             $criteria->add(ChapterregionPeer::CHAPTER_ID, $this->getId());
             ChapterregionPeer::addSelectColumns($criteria);
             $this->collChapterregions = ChapterregionPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(ChapterregionPeer::CHAPTER_ID, $this->getId());
             ChapterregionPeer::addSelectColumns($criteria);
             if (!isset($this->lastChapterregionCriteria) || !$this->lastChapterregionCriteria->equals($criteria)) {
                 $this->collChapterregions = ChapterregionPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastChapterregionCriteria = $criteria;
     return $this->collChapterregions;
 }