コード例 #1
0
 /**
  * If this collection has already been initialized with
  * an identical criteria, it returns the collection.
  * Otherwise if this Agent has previously
  * been saved, it will retrieve related Vocabularys from storage.
  * If this Agent is new, it will return
  * an empty collection or the current collection, the criteria
  * is ignored on a new object.
  *
  * @param      Connection $con
  * @param      Criteria $criteria
  * @throws     PropelException
  */
 public function getVocabularys($criteria = null, $con = null)
 {
     // include the Peer class
     include_once 'lib/model/om/BaseVocabularyPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collVocabularys === null) {
         if ($this->isNew()) {
             $this->collVocabularys = array();
         } else {
             $criteria->add(VocabularyPeer::AGENT_ID, $this->getId());
             VocabularyPeer::addSelectColumns($criteria);
             $this->collVocabularys = VocabularyPeer::doSelect($criteria, $con);
         }
     } else {
         // criteria has no effect for a new object
         if (!$this->isNew()) {
             // the following code is to determine if a new query is
             // called for.  If the criteria is the same as the last
             // one, just return the collection.
             $criteria->add(VocabularyPeer::AGENT_ID, $this->getId());
             VocabularyPeer::addSelectColumns($criteria);
             if (!isset($this->lastVocabularyCriteria) || !$this->lastVocabularyCriteria->equals($criteria)) {
                 $this->collVocabularys = VocabularyPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastVocabularyCriteria = $criteria;
     return $this->collVocabularys;
 }
コード例 #2
0
 /**
  * Selects a collection of Vocabulary objects pre-filled with all related objects except Profile.
  *
  * @return array Array of Vocabulary objects.
  * @throws PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptProfile(Criteria $c, $con = null)
 {
     $c = clone $c;
     // Set the correct dbName if it has not been overridden
     // $c->getDbName() will return the same object if not set to another value
     // so == check is okay and faster
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     VocabularyPeer::addSelectColumns($c);
     $startcol2 = VocabularyPeer::NUM_COLUMNS - VocabularyPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     AgentPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + AgentPeer::NUM_COLUMNS;
     UserPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + UserPeer::NUM_COLUMNS;
     UserPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + UserPeer::NUM_COLUMNS;
     UserPeer::addSelectColumns($c);
     $startcol6 = $startcol5 + UserPeer::NUM_COLUMNS;
     StatusPeer::addSelectColumns($c);
     $startcol7 = $startcol6 + StatusPeer::NUM_COLUMNS;
     $c->addJoin(VocabularyPeer::AGENT_ID, AgentPeer::ID);
     $c->addJoin(VocabularyPeer::CREATED_USER_ID, UserPeer::ID);
     $c->addJoin(VocabularyPeer::UPDATED_USER_ID, UserPeer::ID);
     $c->addJoin(VocabularyPeer::CHILD_UPDATED_USER_ID, UserPeer::ID);
     $c->addJoin(VocabularyPeer::STATUS_ID, StatusPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = VocabularyPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = AgentPeer::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->getAgent();
             //CHECKME
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addVocabulary($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initVocabularys();
             $obj2->addVocabulary($obj1);
         }
         $omClass = UserPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj3 = new $cls();
         $obj3->hydrate($rs, $startcol3);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj3 = $temp_obj1->getUserRelatedByCreatedUserId();
             //CHECKME
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addVocabularyRelatedByCreatedUserId($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initVocabularysRelatedByCreatedUserId();
             $obj3->addVocabularyRelatedByCreatedUserId($obj1);
         }
         $omClass = UserPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj4 = new $cls();
         $obj4->hydrate($rs, $startcol4);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj4 = $temp_obj1->getUserRelatedByUpdatedUserId();
             //CHECKME
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addVocabularyRelatedByUpdatedUserId($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initVocabularysRelatedByUpdatedUserId();
             $obj4->addVocabularyRelatedByUpdatedUserId($obj1);
         }
         $omClass = UserPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj5 = new $cls();
         $obj5->hydrate($rs, $startcol5);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj5 = $temp_obj1->getUserRelatedByChildUpdatedUserId();
             //CHECKME
             if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj5->addVocabularyRelatedByChildUpdatedUserId($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj5->initVocabularysRelatedByChildUpdatedUserId();
             $obj5->addVocabularyRelatedByChildUpdatedUserId($obj1);
         }
         $omClass = StatusPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj6 = new $cls();
         $obj6->hydrate($rs, $startcol6);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj6 = $temp_obj1->getStatus();
             //CHECKME
             if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj6->addVocabulary($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj6->initVocabularys();
             $obj6->addVocabulary($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
コード例 #3
0
 /**
  * Selects a collection of FileImportHistory objects pre-filled with all related objects except Batch.
  *
  * @return array Array of FileImportHistory objects.
  * @throws PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptBatch(Criteria $c, $con = null)
 {
     $c = clone $c;
     // Set the correct dbName if it has not been overridden
     // $c->getDbName() will return the same object if not set to another value
     // so == check is okay and faster
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     FileImportHistoryPeer::addSelectColumns($c);
     $startcol2 = FileImportHistoryPeer::NUM_COLUMNS - FileImportHistoryPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     UserPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + UserPeer::NUM_COLUMNS;
     VocabularyPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + VocabularyPeer::NUM_COLUMNS;
     SchemaPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + SchemaPeer::NUM_COLUMNS;
     $c->addJoin(FileImportHistoryPeer::USER_ID, UserPeer::ID);
     $c->addJoin(FileImportHistoryPeer::VOCABULARY_ID, VocabularyPeer::ID);
     $c->addJoin(FileImportHistoryPeer::SCHEMA_ID, SchemaPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = FileImportHistoryPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = UserPeer::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->getUser();
             //CHECKME
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addFileImportHistory($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initFileImportHistorys();
             $obj2->addFileImportHistory($obj1);
         }
         $omClass = VocabularyPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj3 = new $cls();
         $obj3->hydrate($rs, $startcol3);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj3 = $temp_obj1->getVocabulary();
             //CHECKME
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addFileImportHistory($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initFileImportHistorys();
             $obj3->addFileImportHistory($obj1);
         }
         $omClass = SchemaPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj4 = new $cls();
         $obj4->hydrate($rs, $startcol4);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj4 = $temp_obj1->getSchema();
             //CHECKME
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addFileImportHistory($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initFileImportHistorys();
             $obj4->addFileImportHistory($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
コード例 #4
0
 /**
  * Selects a collection of ConceptPropertyHistory objects pre-filled with all related objects except FileImportHistory.
  *
  * @return array Array of ConceptPropertyHistory objects.
  * @throws PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptFileImportHistory(Criteria $c, $con = null)
 {
     $c = clone $c;
     // Set the correct dbName if it has not been overridden
     // $c->getDbName() will return the same object if not set to another value
     // so == check is okay and faster
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     ConceptPropertyHistoryPeer::addSelectColumns($c);
     $startcol2 = ConceptPropertyHistoryPeer::NUM_COLUMNS - ConceptPropertyHistoryPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     ConceptPropertyPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + ConceptPropertyPeer::NUM_COLUMNS;
     ConceptPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + ConceptPeer::NUM_COLUMNS;
     VocabularyPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + VocabularyPeer::NUM_COLUMNS;
     SkosPropertyPeer::addSelectColumns($c);
     $startcol6 = $startcol5 + SkosPropertyPeer::NUM_COLUMNS;
     VocabularyPeer::addSelectColumns($c);
     $startcol7 = $startcol6 + VocabularyPeer::NUM_COLUMNS;
     ConceptPeer::addSelectColumns($c);
     $startcol8 = $startcol7 + ConceptPeer::NUM_COLUMNS;
     StatusPeer::addSelectColumns($c);
     $startcol9 = $startcol8 + StatusPeer::NUM_COLUMNS;
     UserPeer::addSelectColumns($c);
     $startcol10 = $startcol9 + UserPeer::NUM_COLUMNS;
     $c->addJoin(ConceptPropertyHistoryPeer::CONCEPT_PROPERTY_ID, ConceptPropertyPeer::ID);
     $c->addJoin(ConceptPropertyHistoryPeer::CONCEPT_ID, ConceptPeer::ID);
     $c->addJoin(ConceptPropertyHistoryPeer::VOCABULARY_ID, VocabularyPeer::ID);
     $c->addJoin(ConceptPropertyHistoryPeer::SKOS_PROPERTY_ID, SkosPropertyPeer::ID);
     $c->addJoin(ConceptPropertyHistoryPeer::SCHEME_ID, VocabularyPeer::ID);
     $c->addJoin(ConceptPropertyHistoryPeer::RELATED_CONCEPT_ID, ConceptPeer::ID);
     $c->addJoin(ConceptPropertyHistoryPeer::STATUS_ID, StatusPeer::ID);
     $c->addJoin(ConceptPropertyHistoryPeer::CREATED_USER_ID, UserPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = ConceptPropertyHistoryPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = ConceptPropertyPeer::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->getConceptProperty();
             //CHECKME
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addConceptPropertyHistory($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initConceptPropertyHistorys();
             $obj2->addConceptPropertyHistory($obj1);
         }
         $omClass = ConceptPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj3 = new $cls();
         $obj3->hydrate($rs, $startcol3);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj3 = $temp_obj1->getConceptRelatedByConceptId();
             //CHECKME
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addConceptPropertyHistoryRelatedByConceptId($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initConceptPropertyHistorysRelatedByConceptId();
             $obj3->addConceptPropertyHistoryRelatedByConceptId($obj1);
         }
         $omClass = VocabularyPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj4 = new $cls();
         $obj4->hydrate($rs, $startcol4);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj4 = $temp_obj1->getVocabularyRelatedByVocabularyId();
             //CHECKME
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addConceptPropertyHistoryRelatedByVocabularyId($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initConceptPropertyHistorysRelatedByVocabularyId();
             $obj4->addConceptPropertyHistoryRelatedByVocabularyId($obj1);
         }
         $omClass = SkosPropertyPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj5 = new $cls();
         $obj5->hydrate($rs, $startcol5);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj5 = $temp_obj1->getSkosProperty();
             //CHECKME
             if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj5->addConceptPropertyHistory($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj5->initConceptPropertyHistorys();
             $obj5->addConceptPropertyHistory($obj1);
         }
         $omClass = VocabularyPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj6 = new $cls();
         $obj6->hydrate($rs, $startcol6);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj6 = $temp_obj1->getVocabularyRelatedBySchemeId();
             //CHECKME
             if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj6->addConceptPropertyHistoryRelatedBySchemeId($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj6->initConceptPropertyHistorysRelatedBySchemeId();
             $obj6->addConceptPropertyHistoryRelatedBySchemeId($obj1);
         }
         $omClass = ConceptPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj7 = new $cls();
         $obj7->hydrate($rs, $startcol7);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj7 = $temp_obj1->getConceptRelatedByRelatedConceptId();
             //CHECKME
             if ($temp_obj7->getPrimaryKey() === $obj7->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj7->addConceptPropertyHistoryRelatedByRelatedConceptId($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj7->initConceptPropertyHistorysRelatedByRelatedConceptId();
             $obj7->addConceptPropertyHistoryRelatedByRelatedConceptId($obj1);
         }
         $omClass = StatusPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj8 = new $cls();
         $obj8->hydrate($rs, $startcol8);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj8 = $temp_obj1->getStatus();
             //CHECKME
             if ($temp_obj8->getPrimaryKey() === $obj8->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj8->addConceptPropertyHistory($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj8->initConceptPropertyHistorys();
             $obj8->addConceptPropertyHistory($obj1);
         }
         $omClass = UserPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj9 = new $cls();
         $obj9->hydrate($rs, $startcol9);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj9 = $temp_obj1->getUser();
             //CHECKME
             if ($temp_obj9->getPrimaryKey() === $obj9->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj9->addConceptPropertyHistory($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj9->initConceptPropertyHistorys();
             $obj9->addConceptPropertyHistory($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }