/**
  * Selects a collection of Subscriber objects pre-filled with all related objects.
  *
  * @param      Criteria  $criteria
  * @param      PropelPDO $con
  * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  * @return array           Array of Subscriber objects.
  * @throws PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $criteria = clone $criteria;
     // Set the correct dbName if it has not been overridden
     if ($criteria->getDbName() == Propel::getDefaultDB()) {
         $criteria->setDbName(SubscriberPeer::DATABASE_NAME);
     }
     SubscriberPeer::addSelectColumns($criteria);
     $startcol2 = SubscriberPeer::NUM_HYDRATE_COLUMNS;
     UserPeer::addSelectColumns($criteria);
     $startcol3 = $startcol2 + UserPeer::NUM_HYDRATE_COLUMNS;
     UserPeer::addSelectColumns($criteria);
     $startcol4 = $startcol3 + UserPeer::NUM_HYDRATE_COLUMNS;
     $criteria->addJoin(SubscriberPeer::CREATED_BY, UserPeer::ID, $join_behavior);
     $criteria->addJoin(SubscriberPeer::UPDATED_BY, UserPeer::ID, $join_behavior);
     $stmt = BasePeer::doSelect($criteria, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = SubscriberPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = SubscriberPeer::getInstanceFromPool($key1))) {
             // We no longer rehydrate the object, since this can cause data loss.
             // See http://www.propelorm.org/ticket/509
             // $obj1->hydrate($row, 0, true); // rehydrate
         } else {
             $cls = SubscriberPeer::getOMClass();
             $obj1 = new $cls();
             $obj1->hydrate($row);
             SubscriberPeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined User rows
         $key2 = UserPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = UserPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $cls = UserPeer::getOMClass();
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 UserPeer::addInstanceToPool($obj2, $key2);
             }
             // if obj2 loaded
             // Add the $obj1 (Subscriber) to the collection in $obj2 (User)
             $obj2->addSubscriberRelatedByCreatedBy($obj1);
         }
         // if joined row not null
         // Add objects for joined User rows
         $key3 = UserPeer::getPrimaryKeyHashFromRow($row, $startcol3);
         if ($key3 !== null) {
             $obj3 = UserPeer::getInstanceFromPool($key3);
             if (!$obj3) {
                 $cls = UserPeer::getOMClass();
                 $obj3 = new $cls();
                 $obj3->hydrate($row, $startcol3);
                 UserPeer::addInstanceToPool($obj3, $key3);
             }
             // if obj3 loaded
             // Add the $obj1 (Subscriber) to the collection in $obj3 (User)
             $obj3->addSubscriberRelatedByUpdatedBy($obj1);
         }
         // if joined row not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
 /**
  * Selects a collection of LanguageObjectHistory objects pre-filled with all related objects except Language.
  *
  * @param      Criteria  $criteria
  * @param      PropelPDO $con
  * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  * @return array           Array of LanguageObjectHistory objects.
  * @throws PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptLanguage(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $criteria = clone $criteria;
     // Set the correct dbName if it has not been overridden
     // $criteria->getDbName() will return the same object if not set to another value
     // so == check is okay and faster
     if ($criteria->getDbName() == Propel::getDefaultDB()) {
         $criteria->setDbName(LanguageObjectHistoryPeer::DATABASE_NAME);
     }
     LanguageObjectHistoryPeer::addSelectColumns($criteria);
     $startcol2 = LanguageObjectHistoryPeer::NUM_HYDRATE_COLUMNS;
     ContentObjectPeer::addSelectColumns($criteria);
     $startcol3 = $startcol2 + ContentObjectPeer::NUM_HYDRATE_COLUMNS;
     UserPeer::addSelectColumns($criteria);
     $startcol4 = $startcol3 + UserPeer::NUM_HYDRATE_COLUMNS;
     UserPeer::addSelectColumns($criteria);
     $startcol5 = $startcol4 + UserPeer::NUM_HYDRATE_COLUMNS;
     $criteria->addJoin(LanguageObjectHistoryPeer::OBJECT_ID, ContentObjectPeer::ID, $join_behavior);
     $criteria->addJoin(LanguageObjectHistoryPeer::CREATED_BY, UserPeer::ID, $join_behavior);
     $criteria->addJoin(LanguageObjectHistoryPeer::UPDATED_BY, UserPeer::ID, $join_behavior);
     $stmt = BasePeer::doSelect($criteria, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = LanguageObjectHistoryPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = LanguageObjectHistoryPeer::getInstanceFromPool($key1))) {
             // We no longer rehydrate the object, since this can cause data loss.
             // See http://www.propelorm.org/ticket/509
             // $obj1->hydrate($row, 0, true); // rehydrate
         } else {
             $cls = LanguageObjectHistoryPeer::getOMClass();
             $obj1 = new $cls();
             $obj1->hydrate($row);
             LanguageObjectHistoryPeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined ContentObject rows
         $key2 = ContentObjectPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = ContentObjectPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $cls = ContentObjectPeer::getOMClass();
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 ContentObjectPeer::addInstanceToPool($obj2, $key2);
             }
             // if $obj2 already loaded
             // Add the $obj1 (LanguageObjectHistory) to the collection in $obj2 (ContentObject)
             $obj2->addLanguageObjectHistory($obj1);
         }
         // if joined row is not null
         // Add objects for joined User rows
         $key3 = UserPeer::getPrimaryKeyHashFromRow($row, $startcol3);
         if ($key3 !== null) {
             $obj3 = UserPeer::getInstanceFromPool($key3);
             if (!$obj3) {
                 $cls = UserPeer::getOMClass();
                 $obj3 = new $cls();
                 $obj3->hydrate($row, $startcol3);
                 UserPeer::addInstanceToPool($obj3, $key3);
             }
             // if $obj3 already loaded
             // Add the $obj1 (LanguageObjectHistory) to the collection in $obj3 (User)
             $obj3->addLanguageObjectHistoryRelatedByCreatedBy($obj1);
         }
         // if joined row is not null
         // Add objects for joined User rows
         $key4 = UserPeer::getPrimaryKeyHashFromRow($row, $startcol4);
         if ($key4 !== null) {
             $obj4 = UserPeer::getInstanceFromPool($key4);
             if (!$obj4) {
                 $cls = UserPeer::getOMClass();
                 $obj4 = new $cls();
                 $obj4->hydrate($row, $startcol4);
                 UserPeer::addInstanceToPool($obj4, $key4);
             }
             // if $obj4 already loaded
             // Add the $obj1 (LanguageObjectHistory) to the collection in $obj4 (User)
             $obj4->addLanguageObjectHistoryRelatedByUpdatedBy($obj1);
         }
         // if joined row is not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
Ejemplo n.º 3
0
 public static function doSelectJoinAllExceptQuestion(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     AnswerPeer::addSelectColumns($c);
     $startcol2 = AnswerPeer::NUM_COLUMNS - AnswerPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     UserPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + UserPeer::NUM_COLUMNS;
     $c->addJoin(AnswerPeer::USER_ID, UserPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = AnswerPeer::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();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addAnswer($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initAnswers();
             $obj2->addAnswer($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
Ejemplo n.º 4
0
 /**
  * Selects a collection of Shout objects pre-filled with all related objects.
  *
  * @param      Criteria  $c
  * @param      PropelPDO $con
  * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  * @return     array Array of Shout objects.
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAll(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $c = clone $c;
     // Set the correct dbName if it has not been overridden
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     ShoutPeer::addSelectColumns($c);
     $startcol2 = ShoutPeer::NUM_COLUMNS - ShoutPeer::NUM_LAZY_LOAD_COLUMNS;
     UserPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (UserPeer::NUM_COLUMNS - UserPeer::NUM_LAZY_LOAD_COLUMNS);
     UserPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + (UserPeer::NUM_COLUMNS - UserPeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(ShoutPeer::POSTER_ID), array(UserPeer::ID), $join_behavior);
     $c->addJoin(array(ShoutPeer::RECIPIENT_ID), array(UserPeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = ShoutPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = ShoutPeer::getInstanceFromPool($key1))) {
             // We no longer rehydrate the object, since this can cause data loss.
             // See http://propel.phpdb.org/trac/ticket/509
             // $obj1->hydrate($row, 0, true); // rehydrate
         } else {
             $omClass = ShoutPeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             ShoutPeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined User rows
         $key2 = UserPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = UserPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = UserPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 UserPeer::addInstanceToPool($obj2, $key2);
             }
             // if obj2 loaded
             // Add the $obj1 (Shout) to the collection in $obj2 (User)
             $obj2->addShoutRelatedByPosterId($obj1);
         }
         // if joined row not null
         // Add objects for joined User rows
         $key3 = UserPeer::getPrimaryKeyHashFromRow($row, $startcol3);
         if ($key3 !== null) {
             $obj3 = UserPeer::getInstanceFromPool($key3);
             if (!$obj3) {
                 $omClass = UserPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj3 = new $cls();
                 $obj3->hydrate($row, $startcol3);
                 UserPeer::addInstanceToPool($obj3, $key3);
             }
             // if obj3 loaded
             // Add the $obj1 (Shout) to the collection in $obj3 (User)
             $obj3->addShoutRelatedByRecipientId($obj1);
         }
         // if joined row not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
 /**
  * Selects a collection of SchemaPropertyElementHistory objects pre-filled with all related objects except FileImportHistory.
  *
  * @return array Array of SchemaPropertyElementHistory 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);
     }
     SchemaPropertyElementHistoryPeer::addSelectColumns($c);
     $startcol2 = SchemaPropertyElementHistoryPeer::NUM_COLUMNS - SchemaPropertyElementHistoryPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     UserPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + UserPeer::NUM_COLUMNS;
     SchemaPropertyElementPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + SchemaPropertyElementPeer::NUM_COLUMNS;
     SchemaPropertyPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + SchemaPropertyPeer::NUM_COLUMNS;
     SchemaPeer::addSelectColumns($c);
     $startcol6 = $startcol5 + SchemaPeer::NUM_COLUMNS;
     ProfilePropertyPeer::addSelectColumns($c);
     $startcol7 = $startcol6 + ProfilePropertyPeer::NUM_COLUMNS;
     SchemaPropertyPeer::addSelectColumns($c);
     $startcol8 = $startcol7 + SchemaPropertyPeer::NUM_COLUMNS;
     StatusPeer::addSelectColumns($c);
     $startcol9 = $startcol8 + StatusPeer::NUM_COLUMNS;
     $c->addJoin(SchemaPropertyElementHistoryPeer::CREATED_USER_ID, UserPeer::ID);
     $c->addJoin(SchemaPropertyElementHistoryPeer::SCHEMA_PROPERTY_ELEMENT_ID, SchemaPropertyElementPeer::ID);
     $c->addJoin(SchemaPropertyElementHistoryPeer::SCHEMA_PROPERTY_ID, SchemaPropertyPeer::ID);
     $c->addJoin(SchemaPropertyElementHistoryPeer::SCHEMA_ID, SchemaPeer::ID);
     $c->addJoin(SchemaPropertyElementHistoryPeer::PROFILE_PROPERTY_ID, ProfilePropertyPeer::ID);
     $c->addJoin(SchemaPropertyElementHistoryPeer::RELATED_SCHEMA_PROPERTY_ID, SchemaPropertyPeer::ID);
     $c->addJoin(SchemaPropertyElementHistoryPeer::STATUS_ID, StatusPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = SchemaPropertyElementHistoryPeer::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->addSchemaPropertyElementHistory($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initSchemaPropertyElementHistorys();
             $obj2->addSchemaPropertyElementHistory($obj1);
         }
         $omClass = SchemaPropertyElementPeer::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->getSchemaPropertyElement();
             //CHECKME
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addSchemaPropertyElementHistory($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initSchemaPropertyElementHistorys();
             $obj3->addSchemaPropertyElementHistory($obj1);
         }
         $omClass = SchemaPropertyPeer::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->getSchemaPropertyRelatedBySchemaPropertyId();
             //CHECKME
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addSchemaPropertyElementHistoryRelatedBySchemaPropertyId($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initSchemaPropertyElementHistorysRelatedBySchemaPropertyId();
             $obj4->addSchemaPropertyElementHistoryRelatedBySchemaPropertyId($obj1);
         }
         $omClass = SchemaPeer::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->getSchema();
             //CHECKME
             if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj5->addSchemaPropertyElementHistory($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj5->initSchemaPropertyElementHistorys();
             $obj5->addSchemaPropertyElementHistory($obj1);
         }
         $omClass = ProfilePropertyPeer::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->getProfileProperty();
             //CHECKME
             if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj6->addSchemaPropertyElementHistory($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj6->initSchemaPropertyElementHistorys();
             $obj6->addSchemaPropertyElementHistory($obj1);
         }
         $omClass = SchemaPropertyPeer::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->getSchemaPropertyRelatedByRelatedSchemaPropertyId();
             //CHECKME
             if ($temp_obj7->getPrimaryKey() === $obj7->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj7->addSchemaPropertyElementHistoryRelatedByRelatedSchemaPropertyId($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj7->initSchemaPropertyElementHistorysRelatedByRelatedSchemaPropertyId();
             $obj7->addSchemaPropertyElementHistoryRelatedByRelatedSchemaPropertyId($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->addSchemaPropertyElementHistory($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj8->initSchemaPropertyElementHistorys();
             $obj8->addSchemaPropertyElementHistory($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
Ejemplo n.º 6
0
 /**
  * Prepares the Criteria object and uses the parent doSelect() method to execute a PDOStatement.
  *
  * Use this method directly if you want to work with an executed statement durirectly (for example
  * to perform your own object hydration).
  *
  * @param      Criteria $criteria The Criteria object used to build the SELECT statement.
  * @param      PropelPDO $con The connection to use
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  * @return     PDOStatement The executed PDOStatement object.
  * @see        BasePeer::doSelect()
  */
 public static function doSelectStmt(Criteria $criteria, PropelPDO $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(UserPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     if (!$criteria->hasSelectClause()) {
         $criteria = clone $criteria;
         UserPeer::addSelectColumns($criteria);
     }
     // Set the correct dbName
     $criteria->setDbName(self::DATABASE_NAME);
     // symfony_behaviors behavior
     foreach (sfMixer::getCallables(self::getMixerPreSelectHook(__FUNCTION__)) as $sf_hook) {
         call_user_func($sf_hook, 'BaseUserPeer', $criteria, $con);
     }
     // BasePeer returns a PDOStatement
     return BasePeer::doSelect($criteria, $con);
 }
Ejemplo n.º 7
0
 public static function doSelectJoinAllExceptClassGroup(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     VInfaqPeer::addSelectColumns($c);
     $startcol2 = VInfaqPeer::NUM_COLUMNS - VInfaqPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     AcademicCostPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + AcademicCostPeer::NUM_COLUMNS;
     AcademicCostComponentPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + AcademicCostComponentPeer::NUM_COLUMNS;
     AcademicCalendarPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + AcademicCalendarPeer::NUM_COLUMNS;
     UserPeer::addSelectColumns($c);
     $startcol6 = $startcol5 + UserPeer::NUM_COLUMNS;
     $c->addJoin(VInfaqPeer::ACADEMIC_COST_ID, AcademicCostPeer::ID);
     $c->addJoin(VInfaqPeer::ACADEMIC_COST_COMPONENT_ID, AcademicCostComponentPeer::ID);
     $c->addJoin(VInfaqPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
     $c->addJoin(VInfaqPeer::USER_ID, UserPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = VInfaqPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = AcademicCostPeer::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->getAcademicCost();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addVInfaq($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initVInfaqs();
             $obj2->addVInfaq($obj1);
         }
         $omClass = AcademicCostComponentPeer::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->getAcademicCostComponent();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addVInfaq($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initVInfaqs();
             $obj3->addVInfaq($obj1);
         }
         $omClass = AcademicCalendarPeer::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->getAcademicCalendar();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addVInfaq($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initVInfaqs();
             $obj4->addVInfaq($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->getUser();
             if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj5->addVInfaq($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj5->initVInfaqs();
             $obj5->addVInfaq($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
Ejemplo n.º 8
0
 /**
  * Selects a collection of Document objects pre-filled with all related objects except DocumentData.
  *
  * @param      Criteria  $criteria
  * @param      PropelPDO $con
  * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  * @return array           Array of Document objects.
  * @throws PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptDocumentData(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $criteria = clone $criteria;
     // Set the correct dbName if it has not been overridden
     // $criteria->getDbName() will return the same object if not set to another value
     // so == check is okay and faster
     if ($criteria->getDbName() == Propel::getDefaultDB()) {
         $criteria->setDbName(DocumentPeer::DATABASE_NAME);
     }
     DocumentPeer::addSelectColumns($criteria);
     $startcol2 = DocumentPeer::NUM_HYDRATE_COLUMNS;
     LanguagePeer::addSelectColumns($criteria);
     $startcol3 = $startcol2 + LanguagePeer::NUM_HYDRATE_COLUMNS;
     UserPeer::addSelectColumns($criteria);
     $startcol4 = $startcol3 + UserPeer::NUM_HYDRATE_COLUMNS;
     DocumentTypePeer::addSelectColumns($criteria);
     $startcol5 = $startcol4 + DocumentTypePeer::NUM_HYDRATE_COLUMNS;
     DocumentCategoryPeer::addSelectColumns($criteria);
     $startcol6 = $startcol5 + DocumentCategoryPeer::NUM_HYDRATE_COLUMNS;
     UserPeer::addSelectColumns($criteria);
     $startcol7 = $startcol6 + UserPeer::NUM_HYDRATE_COLUMNS;
     UserPeer::addSelectColumns($criteria);
     $startcol8 = $startcol7 + UserPeer::NUM_HYDRATE_COLUMNS;
     $criteria->addJoin(DocumentPeer::LANGUAGE_ID, LanguagePeer::ID, $join_behavior);
     $criteria->addJoin(DocumentPeer::OWNER_ID, UserPeer::ID, $join_behavior);
     $criteria->addJoin(DocumentPeer::DOCUMENT_TYPE_ID, DocumentTypePeer::ID, $join_behavior);
     $criteria->addJoin(DocumentPeer::DOCUMENT_CATEGORY_ID, DocumentCategoryPeer::ID, $join_behavior);
     $criteria->addJoin(DocumentPeer::CREATED_BY, UserPeer::ID, $join_behavior);
     $criteria->addJoin(DocumentPeer::UPDATED_BY, UserPeer::ID, $join_behavior);
     $stmt = BasePeer::doSelect($criteria, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = DocumentPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = DocumentPeer::getInstanceFromPool($key1))) {
             // We no longer rehydrate the object, since this can cause data loss.
             // See http://www.propelorm.org/ticket/509
             // $obj1->hydrate($row, 0, true); // rehydrate
         } else {
             $cls = DocumentPeer::getOMClass();
             $obj1 = new $cls();
             $obj1->hydrate($row);
             DocumentPeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined Language rows
         $key2 = LanguagePeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = LanguagePeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $cls = LanguagePeer::getOMClass();
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 LanguagePeer::addInstanceToPool($obj2, $key2);
             }
             // if $obj2 already loaded
             // Add the $obj1 (Document) to the collection in $obj2 (Language)
             $obj2->addDocument($obj1);
         }
         // if joined row is not null
         // Add objects for joined User rows
         $key3 = UserPeer::getPrimaryKeyHashFromRow($row, $startcol3);
         if ($key3 !== null) {
             $obj3 = UserPeer::getInstanceFromPool($key3);
             if (!$obj3) {
                 $cls = UserPeer::getOMClass();
                 $obj3 = new $cls();
                 $obj3->hydrate($row, $startcol3);
                 UserPeer::addInstanceToPool($obj3, $key3);
             }
             // if $obj3 already loaded
             // Add the $obj1 (Document) to the collection in $obj3 (User)
             $obj3->addDocumentRelatedByOwnerId($obj1);
         }
         // if joined row is not null
         // Add objects for joined DocumentType rows
         $key4 = DocumentTypePeer::getPrimaryKeyHashFromRow($row, $startcol4);
         if ($key4 !== null) {
             $obj4 = DocumentTypePeer::getInstanceFromPool($key4);
             if (!$obj4) {
                 $cls = DocumentTypePeer::getOMClass();
                 $obj4 = new $cls();
                 $obj4->hydrate($row, $startcol4);
                 DocumentTypePeer::addInstanceToPool($obj4, $key4);
             }
             // if $obj4 already loaded
             // Add the $obj1 (Document) to the collection in $obj4 (DocumentType)
             $obj4->addDocument($obj1);
         }
         // if joined row is not null
         // Add objects for joined DocumentCategory rows
         $key5 = DocumentCategoryPeer::getPrimaryKeyHashFromRow($row, $startcol5);
         if ($key5 !== null) {
             $obj5 = DocumentCategoryPeer::getInstanceFromPool($key5);
             if (!$obj5) {
                 $cls = DocumentCategoryPeer::getOMClass();
                 $obj5 = new $cls();
                 $obj5->hydrate($row, $startcol5);
                 DocumentCategoryPeer::addInstanceToPool($obj5, $key5);
             }
             // if $obj5 already loaded
             // Add the $obj1 (Document) to the collection in $obj5 (DocumentCategory)
             $obj5->addDocument($obj1);
         }
         // if joined row is not null
         // Add objects for joined User rows
         $key6 = UserPeer::getPrimaryKeyHashFromRow($row, $startcol6);
         if ($key6 !== null) {
             $obj6 = UserPeer::getInstanceFromPool($key6);
             if (!$obj6) {
                 $cls = UserPeer::getOMClass();
                 $obj6 = new $cls();
                 $obj6->hydrate($row, $startcol6);
                 UserPeer::addInstanceToPool($obj6, $key6);
             }
             // if $obj6 already loaded
             // Add the $obj1 (Document) to the collection in $obj6 (User)
             $obj6->addDocumentRelatedByCreatedBy($obj1);
         }
         // if joined row is not null
         // Add objects for joined User rows
         $key7 = UserPeer::getPrimaryKeyHashFromRow($row, $startcol7);
         if ($key7 !== null) {
             $obj7 = UserPeer::getInstanceFromPool($key7);
             if (!$obj7) {
                 $cls = UserPeer::getOMClass();
                 $obj7 = new $cls();
                 $obj7->hydrate($row, $startcol7);
                 UserPeer::addInstanceToPool($obj7, $key7);
             }
             // if $obj7 already loaded
             // Add the $obj1 (Document) to the collection in $obj7 (User)
             $obj7->addDocumentRelatedByUpdatedBy($obj1);
         }
         // if joined row is not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
Ejemplo n.º 9
0
 public static function doSelectJoinAllExceptAcademicCalendar(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     VSppPeer::addSelectColumns($c);
     $startcol2 = VSppPeer::NUM_COLUMNS - VSppPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     StudentPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + StudentPeer::NUM_COLUMNS;
     AcademicCostPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + AcademicCostPeer::NUM_COLUMNS;
     UserPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + UserPeer::NUM_COLUMNS;
     AcademicProcessPeer::addSelectColumns($c);
     $startcol6 = $startcol5 + AcademicProcessPeer::NUM_COLUMNS;
     PaymentModelPeer::addSelectColumns($c);
     $startcol7 = $startcol6 + PaymentModelPeer::NUM_COLUMNS;
     TransactionStatusPeer::addSelectColumns($c);
     $startcol8 = $startcol7 + TransactionStatusPeer::NUM_COLUMNS;
     AcademicCostComponentPeer::addSelectColumns($c);
     $startcol9 = $startcol8 + AcademicCostComponentPeer::NUM_COLUMNS;
     $c->addJoin(VSppPeer::STUDENT_ID, StudentPeer::ID);
     $c->addJoin(VSppPeer::ACADEMIC_COST_ID, AcademicCostPeer::ID);
     $c->addJoin(VSppPeer::USER_ID, UserPeer::ID);
     $c->addJoin(VSppPeer::ACADEMIC_PROCESS_ID, AcademicProcessPeer::ID);
     $c->addJoin(VSppPeer::PAYMENT_MODEL_ID, PaymentModelPeer::ID);
     $c->addJoin(VSppPeer::TRANSACTION_STATUS_ID, TransactionStatusPeer::ID);
     $c->addJoin(VSppPeer::ACADEMIC_COST_COMPONENT_ID, AcademicCostComponentPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = VSppPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = StudentPeer::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->getStudent();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addVSpp($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initVSpps();
             $obj2->addVSpp($obj1);
         }
         $omClass = AcademicCostPeer::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->getAcademicCost();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addVSpp($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initVSpps();
             $obj3->addVSpp($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->getUser();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addVSpp($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initVSpps();
             $obj4->addVSpp($obj1);
         }
         $omClass = AcademicProcessPeer::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->getAcademicProcess();
             if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj5->addVSpp($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj5->initVSpps();
             $obj5->addVSpp($obj1);
         }
         $omClass = PaymentModelPeer::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->getPaymentModel();
             if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj6->addVSpp($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj6->initVSpps();
             $obj6->addVSpp($obj1);
         }
         $omClass = TransactionStatusPeer::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->getTransactionStatus();
             if ($temp_obj7->getPrimaryKey() === $obj7->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj7->addVSpp($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj7->initVSpps();
             $obj7->addVSpp($obj1);
         }
         $omClass = AcademicCostComponentPeer::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->getAcademicCostComponent();
             if ($temp_obj8->getPrimaryKey() === $obj8->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj8->addVSpp($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj8->initVSpps();
             $obj8->addVSpp($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
 /**
  * Selects a collection of ConceptProperty objects pre-filled with all related objects except ProfilePropertyRelatedByProfilePropertyId.
  *
  * @return array Array of ConceptProperty objects.
  * @throws PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptProfilePropertyRelatedByProfilePropertyId(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);
     }
     ConceptPropertyPeer::addSelectColumns($c);
     $startcol2 = ConceptPropertyPeer::NUM_COLUMNS - ConceptPropertyPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     UserPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + UserPeer::NUM_COLUMNS;
     UserPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + UserPeer::NUM_COLUMNS;
     ConceptPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + ConceptPeer::NUM_COLUMNS;
     VocabularyPeer::addSelectColumns($c);
     $startcol6 = $startcol5 + VocabularyPeer::NUM_COLUMNS;
     ConceptPeer::addSelectColumns($c);
     $startcol7 = $startcol6 + ConceptPeer::NUM_COLUMNS;
     StatusPeer::addSelectColumns($c);
     $startcol8 = $startcol7 + StatusPeer::NUM_COLUMNS;
     $c->addJoin(ConceptPropertyPeer::CREATED_USER_ID, UserPeer::ID);
     $c->addJoin(ConceptPropertyPeer::UPDATED_USER_ID, UserPeer::ID);
     $c->addJoin(ConceptPropertyPeer::CONCEPT_ID, ConceptPeer::ID);
     $c->addJoin(ConceptPropertyPeer::SCHEME_ID, VocabularyPeer::ID);
     $c->addJoin(ConceptPropertyPeer::RELATED_CONCEPT_ID, ConceptPeer::ID);
     $c->addJoin(ConceptPropertyPeer::STATUS_ID, StatusPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = ConceptPropertyPeer::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->getUserRelatedByCreatedUserId();
             //CHECKME
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addConceptPropertyRelatedByCreatedUserId($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initConceptPropertysRelatedByCreatedUserId();
             $obj2->addConceptPropertyRelatedByCreatedUserId($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->getUserRelatedByUpdatedUserId();
             //CHECKME
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addConceptPropertyRelatedByUpdatedUserId($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initConceptPropertysRelatedByUpdatedUserId();
             $obj3->addConceptPropertyRelatedByUpdatedUserId($obj1);
         }
         $omClass = ConceptPeer::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->getConceptRelatedByConceptId();
             //CHECKME
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addConceptPropertyRelatedByConceptId($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initConceptPropertysRelatedByConceptId();
             $obj4->addConceptPropertyRelatedByConceptId($obj1);
         }
         $omClass = VocabularyPeer::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->getVocabulary();
             //CHECKME
             if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj5->addConceptProperty($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj5->initConceptPropertys();
             $obj5->addConceptProperty($obj1);
         }
         $omClass = ConceptPeer::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->getConceptRelatedByRelatedConceptId();
             //CHECKME
             if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj6->addConceptPropertyRelatedByRelatedConceptId($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj6->initConceptPropertysRelatedByRelatedConceptId();
             $obj6->addConceptPropertyRelatedByRelatedConceptId($obj1);
         }
         $omClass = StatusPeer::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->getStatus();
             //CHECKME
             if ($temp_obj7->getPrimaryKey() === $obj7->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj7->addConceptProperty($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj7->initConceptPropertys();
             $obj7->addConceptProperty($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
Ejemplo n.º 11
0
 public static function doSelectRS(Criteria $criteria, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     if (!$criteria->getSelectColumns()) {
         $criteria = clone $criteria;
         UserPeer::addSelectColumns($criteria);
     }
     $criteria->setDbName(self::DATABASE_NAME);
     return BasePeer::doSelect($criteria, $con);
 }
Ejemplo n.º 12
0
 /**
  * Selects a collection of Task objects pre-filled with all related objects except Priority.
  *
  * @param      Criteria  $criteria
  * @param      PropelPDO $con
  * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  * @return     array Array of Task objects.
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptPriority(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $criteria = clone $criteria;
     // Set the correct dbName if it has not been overridden
     // $criteria->getDbName() will return the same object if not set to another value
     // so == check is okay and faster
     if ($criteria->getDbName() == Propel::getDefaultDB()) {
         $criteria->setDbName(self::DATABASE_NAME);
     }
     TaskPeer::addSelectColumns($criteria);
     $startcol2 = TaskPeer::NUM_COLUMNS - TaskPeer::NUM_LAZY_LOAD_COLUMNS;
     ProjectPeer::addSelectColumns($criteria);
     $startcol3 = $startcol2 + (ProjectPeer::NUM_COLUMNS - ProjectPeer::NUM_LAZY_LOAD_COLUMNS);
     StatusPeer::addSelectColumns($criteria);
     $startcol4 = $startcol3 + (StatusPeer::NUM_COLUMNS - StatusPeer::NUM_LAZY_LOAD_COLUMNS);
     UserPeer::addSelectColumns($criteria);
     $startcol5 = $startcol4 + (UserPeer::NUM_COLUMNS - UserPeer::NUM_LAZY_LOAD_COLUMNS);
     $criteria->addJoin(TaskPeer::PROJECT_ID, ProjectPeer::ID, $join_behavior);
     $criteria->addJoin(TaskPeer::STATUS_ID, StatusPeer::ID, $join_behavior);
     $criteria->addJoin(TaskPeer::LEAD_ID, UserPeer::ID, $join_behavior);
     $stmt = BasePeer::doSelect($criteria, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = TaskPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = TaskPeer::getInstanceFromPool($key1))) {
             // We no longer rehydrate the object, since this can cause data loss.
             // See http://propel.phpdb.org/trac/ticket/509
             // $obj1->hydrate($row, 0, true); // rehydrate
         } else {
             $cls = TaskPeer::getOMClass(false);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             TaskPeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined Project rows
         $key2 = ProjectPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = ProjectPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $cls = ProjectPeer::getOMClass(false);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 ProjectPeer::addInstanceToPool($obj2, $key2);
             }
             // if $obj2 already loaded
             // Add the $obj1 (Task) to the collection in $obj2 (Project)
             $obj2->addTask($obj1);
         }
         // if joined row is not null
         // Add objects for joined Status rows
         $key3 = StatusPeer::getPrimaryKeyHashFromRow($row, $startcol3);
         if ($key3 !== null) {
             $obj3 = StatusPeer::getInstanceFromPool($key3);
             if (!$obj3) {
                 $cls = StatusPeer::getOMClass(false);
                 $obj3 = new $cls();
                 $obj3->hydrate($row, $startcol3);
                 StatusPeer::addInstanceToPool($obj3, $key3);
             }
             // if $obj3 already loaded
             // Add the $obj1 (Task) to the collection in $obj3 (Status)
             $obj3->addTask($obj1);
         }
         // if joined row is not null
         // Add objects for joined User rows
         $key4 = UserPeer::getPrimaryKeyHashFromRow($row, $startcol4);
         if ($key4 !== null) {
             $obj4 = UserPeer::getInstanceFromPool($key4);
             if (!$obj4) {
                 $cls = UserPeer::getOMClass(false);
                 $obj4 = new $cls();
                 $obj4->hydrate($row, $startcol4);
                 UserPeer::addInstanceToPool($obj4, $key4);
             }
             // if $obj4 already loaded
             // Add the $obj1 (Task) to the collection in $obj4 (User)
             $obj4->addTask($obj1);
         }
         // if joined row is not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
 /**
  * Selects a collection of Room objects pre-filled with all related objects.
  *
  * @return     array Array of Room objects.
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAll(Criteria $c, $con = null)
 {
     $c = clone $c;
     // Set the correct dbName if it has not been overridden
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     RoomPeer::addSelectColumns($c);
     $startcol2 = RoomPeer::NUM_COLUMNS - RoomPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     UserPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + UserPeer::NUM_COLUMNS;
     $c->addJoin(RoomPeer::USER_ID, UserPeer::USER_ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = RoomPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         // Add objects for joined User rows
         $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->addRoom($obj1);
                 // CHECKME
                 break;
             }
         }
         if ($newObject) {
             $obj2->initRooms();
             $obj2->addRoom($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
Ejemplo n.º 14
0
 public function getUsers($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseUserPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collUsers === null) {
         if ($this->isNew()) {
             $this->collUsers = array();
         } else {
             $criteria->add(UserPeer::DEPARTMENT_ID, $this->getId());
             UserPeer::addSelectColumns($criteria);
             $this->collUsers = UserPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(UserPeer::DEPARTMENT_ID, $this->getId());
             UserPeer::addSelectColumns($criteria);
             if (!isset($this->lastUserCriteria) || !$this->lastUserCriteria->equals($criteria)) {
                 $this->collUsers = UserPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastUserCriteria = $criteria;
     return $this->collUsers;
 }
Ejemplo n.º 15
0
 /**
  * Selects a collection of Session objects pre-filled with all related objects.
  *
  * @param      Criteria  $criteria
  * @param      PropelPDO $con
  * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  * @return array           Array of Session objects.
  * @throws PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $criteria = clone $criteria;
     // Set the correct dbName if it has not been overridden
     if ($criteria->getDbName() == Propel::getDefaultDB()) {
         $criteria->setDbName(self::DATABASE_NAME);
     }
     SessionPeer::addSelectColumns($criteria);
     $startcol2 = SessionPeer::NUM_HYDRATE_COLUMNS;
     UserPeer::addSelectColumns($criteria);
     $startcol3 = $startcol2 + UserPeer::NUM_HYDRATE_COLUMNS;
     $criteria->addJoin(SessionPeer::USER_ID, UserPeer::ID, $join_behavior);
     // symfony_behaviors behavior
     foreach (sfMixer::getCallables(self::getMixerPreSelectHook(__FUNCTION__)) as $sf_hook) {
         call_user_func($sf_hook, 'BaseSessionPeer', $criteria, $con);
     }
     $stmt = BasePeer::doSelect($criteria, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = SessionPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = SessionPeer::getInstanceFromPool($key1))) {
             // We no longer rehydrate the object, since this can cause data loss.
             // See http://www.propelorm.org/ticket/509
             // $obj1->hydrate($row, 0, true); // rehydrate
         } else {
             $cls = SessionPeer::getOMClass();
             $obj1 = new $cls();
             $obj1->hydrate($row);
             SessionPeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined User rows
         $key2 = UserPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = UserPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $cls = UserPeer::getOMClass();
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 UserPeer::addInstanceToPool($obj2, $key2);
             }
             // if obj2 loaded
             // Add the $obj1 (Session) to the collection in $obj2 (User)
             $obj2->addSession($obj1);
         }
         // if joined row not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
 /**
  * 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;
 }
 /**
  * Prepares the Criteria object and uses the parent doSelect()
  * method to get a ResultSet.
  *
  * Use this method directly if you want to just get the resultset
  * (instead of an array of objects).
  *
  * @param      Criteria $criteria The Criteria object used to build the SELECT statement.
  * @param      Connection $con the connection to use
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  * @return     ResultSet The resultset object with numerically-indexed fields.
  * @see        BasePeer::doSelect()
  */
 public static function doSelectRS(Criteria $criteria, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     if (!$criteria->getSelectColumns()) {
         $criteria = clone $criteria;
         UserPeer::addSelectColumns($criteria);
     }
     // Set the correct dbName
     $criteria->setDbName(self::DATABASE_NAME);
     // BasePeer returns a Creole ResultSet, set to return
     // rows indexed numerically.
     return BasePeer::doSelect($criteria, $con);
 }
Ejemplo n.º 18
0
 /**
  * Selects a collection of Profile objects pre-filled with all related objects except Status.
  *
  * @return array Array of Profile objects.
  * @throws PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptStatus(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);
     }
     ProfilePeer::addSelectColumns($c);
     $startcol2 = ProfilePeer::NUM_COLUMNS - ProfilePeer::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;
     UserPeer::addSelectColumns($c);
     $startcol7 = $startcol6 + UserPeer::NUM_COLUMNS;
     $c->addJoin(ProfilePeer::AGENT_ID, AgentPeer::ID);
     $c->addJoin(ProfilePeer::CREATED_BY, UserPeer::ID);
     $c->addJoin(ProfilePeer::UPDATED_BY, UserPeer::ID);
     $c->addJoin(ProfilePeer::DELETED_BY, UserPeer::ID);
     $c->addJoin(ProfilePeer::CHILD_UPDATED_BY, UserPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = ProfilePeer::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->addProfile($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initProfiles();
             $obj2->addProfile($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->getUserRelatedByCreatedBy();
             //CHECKME
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addProfileRelatedByCreatedBy($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initProfilesRelatedByCreatedBy();
             $obj3->addProfileRelatedByCreatedBy($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->getUserRelatedByUpdatedBy();
             //CHECKME
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addProfileRelatedByUpdatedBy($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initProfilesRelatedByUpdatedBy();
             $obj4->addProfileRelatedByUpdatedBy($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->getUserRelatedByDeletedBy();
             //CHECKME
             if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj5->addProfileRelatedByDeletedBy($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj5->initProfilesRelatedByDeletedBy();
             $obj5->addProfileRelatedByDeletedBy($obj1);
         }
         $omClass = UserPeer::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->getUserRelatedByChildUpdatedBy();
             //CHECKME
             if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj6->addProfileRelatedByChildUpdatedBy($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj6->initProfilesRelatedByChildUpdatedBy();
             $obj6->addProfileRelatedByChildUpdatedBy($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
Ejemplo n.º 19
0
 /**
  * Selects a collection of Link objects pre-filled with all related objects.
  *
  * @param      Criteria  $criteria
  * @param      PropelPDO $con
  * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  * @return     array Array of Link objects.
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $criteria = clone $criteria;
     // Set the correct dbName if it has not been overridden
     if ($criteria->getDbName() == Propel::getDefaultDB()) {
         $criteria->setDbName(self::DATABASE_NAME);
     }
     LinkPeer::addSelectColumns($criteria);
     $startcol2 = LinkPeer::NUM_COLUMNS - LinkPeer::NUM_LAZY_LOAD_COLUMNS;
     UserPeer::addSelectColumns($criteria);
     $startcol3 = $startcol2 + (UserPeer::NUM_COLUMNS - UserPeer::NUM_LAZY_LOAD_COLUMNS);
     $criteria->addJoin(LinkPeer::USER_ID, UserPeer::ID, $join_behavior);
     $stmt = BasePeer::doSelect($criteria, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = LinkPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = LinkPeer::getInstanceFromPool($key1))) {
             // We no longer rehydrate the object, since this can cause data loss.
             // See http://propel.phpdb.org/trac/ticket/509
             // $obj1->hydrate($row, 0, true); // rehydrate
         } else {
             $cls = LinkPeer::getOMClass(false);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             LinkPeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined User rows
         $key2 = UserPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = UserPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $cls = UserPeer::getOMClass(false);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 UserPeer::addInstanceToPool($obj2, $key2);
             }
             // if obj2 loaded
             // Add the $obj1 (Link) to the collection in $obj2 (User)
             $obj2->addLink($obj1);
         }
         // if joined row not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
Ejemplo n.º 20
0
 /**
  * Prepares the Criteria object and uses the parent doSelect() method to execute a PDOStatement.
  *
  * Use this method directly if you want to work with an executed statement durirectly (for example
  * to perform your own object hydration).
  *
  * @param      Criteria $criteria The Criteria object used to build the SELECT statement.
  * @param      PropelPDO $con The connection to use
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  * @return     PDOStatement The executed PDOStatement object.
  * @see        BasePeer::doSelect()
  */
 public static function doSelectStmt(Criteria $criteria, PropelPDO $con = null)
 {
     foreach (sfMixer::getCallables('BaseUserPeer:doSelectStmt:doSelectStmt') as $callable) {
         call_user_func($callable, 'BaseUserPeer', $criteria, $con);
     }
     if ($con === null) {
         $con = Propel::getConnection(UserPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     if (!$criteria->hasSelectClause()) {
         $criteria = clone $criteria;
         UserPeer::addSelectColumns($criteria);
     }
     // Set the correct dbName
     $criteria->setDbName(self::DATABASE_NAME);
     // BasePeer returns a PDOStatement
     return BasePeer::doSelect($criteria, $con);
 }
 /**
  * Selects a collection of Message objects pre-filled with all related objects except Production.
  *
  * @return     array Array of Message objects.
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptProduction(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);
     }
     MessagePeer::addSelectColumns($c);
     $startcol2 = MessagePeer::NUM_COLUMNS - MessagePeer::NUM_LAZY_LOAD_COLUMNS + 1;
     UserPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + UserPeer::NUM_COLUMNS;
     $c->addJoin(MessagePeer::USER_ID, UserPeer::USER_ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = MessagePeer::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->addMessage($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initMessages();
             $obj2->addMessage($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
Ejemplo n.º 22
0
 /**
  * Selects a collection of GameMember objects pre-filled with all related objects except Game.
  *
  * @param      Criteria  $c
  * @param      PropelPDO $con
  * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  * @return     array Array of GameMember objects.
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptGame(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $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);
     }
     GameMemberPeer::addSelectColumns($c);
     $startcol2 = GameMemberPeer::NUM_COLUMNS - GameMemberPeer::NUM_LAZY_LOAD_COLUMNS;
     UserPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (UserPeer::NUM_COLUMNS - UserPeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(GameMemberPeer::USER_ID), array(UserPeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = GameMemberPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = GameMemberPeer::getInstanceFromPool($key1))) {
             // We no longer rehydrate the object, since this can cause data loss.
             // See http://propel.phpdb.org/trac/ticket/509
             // $obj1->hydrate($row, 0, true); // rehydrate
         } else {
             $omClass = GameMemberPeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             GameMemberPeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined User rows
         $key2 = UserPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = UserPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = UserPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 UserPeer::addInstanceToPool($obj2, $key2);
             }
             // if $obj2 already loaded
             // Add the $obj1 (GameMember) to the collection in $obj2 (User)
             $obj2->addGameMember($obj1);
         }
         // if joined row is not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
Ejemplo n.º 23
0
 /**
  * Prepares the Criteria object and uses the parent doSelect() method to execute a PDOStatement.
  *
  * Use this method directly if you want to work with an executed statement durirectly (for example
  * to perform your own object hydration).
  *
  * @param      Criteria $criteria The Criteria object used to build the SELECT statement.
  * @param      PropelPDO $con The connection to use
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  * @return     PDOStatement The executed PDOStatement object.
  * @see        BasePeer::doSelect()
  */
 public static function doSelectStmt(Criteria $criteria, PropelPDO $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(UserPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     if (!$criteria->getSelectColumns()) {
         $criteria = clone $criteria;
         UserPeer::addSelectColumns($criteria);
     }
     // Set the correct dbName
     $criteria->setDbName(self::DATABASE_NAME);
     // BasePeer returns a PDOStatement
     return BasePeer::doSelect($criteria, $con);
 }
Ejemplo n.º 24
0
 /**
  * Selects a collection of Comment objects pre-filled with all related objects except Post.
  *
  * @param      Criteria  $criteria
  * @param      PropelPDO $con
  * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  * @return     array Array of Comment objects.
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptPost(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $criteria = clone $criteria;
     // Set the correct dbName if it has not been overridden
     // $criteria->getDbName() will return the same object if not set to another value
     // so == check is okay and faster
     if ($criteria->getDbName() == Propel::getDefaultDB()) {
         $criteria->setDbName(self::DATABASE_NAME);
     }
     CommentPeer::addSelectColumns($criteria);
     $startcol2 = CommentPeer::NUM_COLUMNS - CommentPeer::NUM_LAZY_LOAD_COLUMNS;
     UserPeer::addSelectColumns($criteria);
     $startcol3 = $startcol2 + (UserPeer::NUM_COLUMNS - UserPeer::NUM_LAZY_LOAD_COLUMNS);
     $criteria->addJoin(CommentPeer::USER_ID, UserPeer::ID, $join_behavior);
     // symfony_behaviors behavior
     foreach (sfMixer::getCallables(self::getMixerPreSelectHook(__FUNCTION__)) as $sf_hook) {
         call_user_func($sf_hook, 'BaseCommentPeer', $criteria, $con);
     }
     $stmt = BasePeer::doSelect($criteria, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = CommentPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = CommentPeer::getInstanceFromPool($key1))) {
             // We no longer rehydrate the object, since this can cause data loss.
             // See http://propel.phpdb.org/trac/ticket/509
             // $obj1->hydrate($row, 0, true); // rehydrate
         } else {
             $cls = CommentPeer::getOMClass(false);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             CommentPeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined User rows
         $key2 = UserPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = UserPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $cls = UserPeer::getOMClass(false);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 UserPeer::addInstanceToPool($obj2, $key2);
             }
             // if $obj2 already loaded
             // Add the $obj1 (Comment) to the collection in $obj2 (User)
             $obj2->addComment($obj1);
         }
         // if joined row is not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
Ejemplo n.º 25
0
 /**
  * Selects a collection of Subscription objects pre-filled with all related objects except Usergroup.
  *
  * @param      Criteria  $c
  * @param      PropelPDO $con
  * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  * @return     array Array of Subscription objects.
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptUsergroup(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $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);
     }
     SubscriptionPeer::addSelectColumns($c);
     $startcol2 = SubscriptionPeer::NUM_COLUMNS - SubscriptionPeer::NUM_LAZY_LOAD_COLUMNS;
     ActivityPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (ActivityPeer::NUM_COLUMNS - ActivityPeer::NUM_LAZY_LOAD_COLUMNS);
     ZonePeer::addSelectColumns($c);
     $startcol4 = $startcol3 + (ZonePeer::NUM_COLUMNS - ZonePeer::NUM_LAZY_LOAD_COLUMNS);
     CardPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + (CardPeer::NUM_COLUMNS - CardPeer::NUM_LAZY_LOAD_COLUMNS);
     UserPeer::addSelectColumns($c);
     $startcol6 = $startcol5 + (UserPeer::NUM_COLUMNS - UserPeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(SubscriptionPeer::ACTIVITY_ID), array(ActivityPeer::ID), $join_behavior);
     $c->addJoin(array(SubscriptionPeer::ZONE_ID), array(ZonePeer::ID), $join_behavior);
     $c->addJoin(array(SubscriptionPeer::CARD_ID), array(CardPeer::ID), $join_behavior);
     $c->addJoin(array(SubscriptionPeer::USER_ID), array(UserPeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = SubscriptionPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = SubscriptionPeer::getInstanceFromPool($key1))) {
             // We no longer rehydrate the object, since this can cause data loss.
             // See http://propel.phpdb.org/trac/ticket/509
             // $obj1->hydrate($row, 0, true); // rehydrate
         } else {
             $omClass = SubscriptionPeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             SubscriptionPeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined Activity rows
         $key2 = ActivityPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = ActivityPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = ActivityPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 ActivityPeer::addInstanceToPool($obj2, $key2);
             }
             // if $obj2 already loaded
             // Add the $obj1 (Subscription) to the collection in $obj2 (Activity)
             $obj2->addSubscription($obj1);
         }
         // if joined row is not null
         // Add objects for joined Zone rows
         $key3 = ZonePeer::getPrimaryKeyHashFromRow($row, $startcol3);
         if ($key3 !== null) {
             $obj3 = ZonePeer::getInstanceFromPool($key3);
             if (!$obj3) {
                 $omClass = ZonePeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj3 = new $cls();
                 $obj3->hydrate($row, $startcol3);
                 ZonePeer::addInstanceToPool($obj3, $key3);
             }
             // if $obj3 already loaded
             // Add the $obj1 (Subscription) to the collection in $obj3 (Zone)
             $obj3->addSubscription($obj1);
         }
         // if joined row is not null
         // Add objects for joined Card rows
         $key4 = CardPeer::getPrimaryKeyHashFromRow($row, $startcol4);
         if ($key4 !== null) {
             $obj4 = CardPeer::getInstanceFromPool($key4);
             if (!$obj4) {
                 $omClass = CardPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj4 = new $cls();
                 $obj4->hydrate($row, $startcol4);
                 CardPeer::addInstanceToPool($obj4, $key4);
             }
             // if $obj4 already loaded
             // Add the $obj1 (Subscription) to the collection in $obj4 (Card)
             $obj4->addSubscription($obj1);
         }
         // if joined row is not null
         // Add objects for joined User rows
         $key5 = UserPeer::getPrimaryKeyHashFromRow($row, $startcol5);
         if ($key5 !== null) {
             $obj5 = UserPeer::getInstanceFromPool($key5);
             if (!$obj5) {
                 $omClass = UserPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj5 = new $cls();
                 $obj5->hydrate($row, $startcol5);
                 UserPeer::addInstanceToPool($obj5, $key5);
             }
             // if $obj5 already loaded
             // Add the $obj1 (Subscription) to the collection in $obj5 (User)
             $obj5->addSubscription($obj1);
         }
         // if joined row is not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
Ejemplo n.º 26
0
 /**
  * Selects a collection of Job objects pre-filled with all related objects except Chart.
  *
  * @param      Criteria  $criteria
  * @param      PropelPDO $con
  * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  * @return array           Array of Job objects.
  * @throws PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptChart(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $criteria = clone $criteria;
     // Set the correct dbName if it has not been overridden
     // $criteria->getDbName() will return the same object if not set to another value
     // so == check is okay and faster
     if ($criteria->getDbName() == Propel::getDefaultDB()) {
         $criteria->setDbName(JobPeer::DATABASE_NAME);
     }
     JobPeer::addSelectColumns($criteria);
     $startcol2 = JobPeer::NUM_HYDRATE_COLUMNS;
     UserPeer::addSelectColumns($criteria);
     $startcol3 = $startcol2 + UserPeer::NUM_HYDRATE_COLUMNS;
     $criteria->addJoin(JobPeer::USER_ID, UserPeer::ID, $join_behavior);
     $stmt = BasePeer::doSelect($criteria, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = JobPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = JobPeer::getInstanceFromPool($key1))) {
             // We no longer rehydrate the object, since this can cause data loss.
             // See http://www.propelorm.org/ticket/509
             // $obj1->hydrate($row, 0, true); // rehydrate
         } else {
             $cls = JobPeer::getOMClass();
             $obj1 = new $cls();
             $obj1->hydrate($row);
             JobPeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined User rows
         $key2 = UserPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = UserPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $cls = UserPeer::getOMClass();
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 UserPeer::addInstanceToPool($obj2, $key2);
             }
             // if $obj2 already loaded
             // Add the $obj1 (Job) to the collection in $obj2 (User)
             $obj2->addJob($obj1);
         }
         // if joined row is not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
Ejemplo n.º 27
0
 /**
  * Selects a collection of User objects pre-filled with all related objects.
  *
  * @param      Criteria  $c
  * @param      PropelPDO $con
  * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  * @return     array Array of User objects.
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAll(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     foreach (sfMixer::getCallables('BaseUserPeer:doSelectJoinAll:doSelectJoinAll') as $callable) {
         call_user_func($callable, 'BaseUserPeer', $c, $con);
     }
     $c = clone $c;
     // Set the correct dbName if it has not been overridden
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     UserPeer::addSelectColumns($c);
     $startcol2 = UserPeer::NUM_COLUMNS - UserPeer::NUM_LAZY_LOAD_COLUMNS;
     EnumItemPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (EnumItemPeer::NUM_COLUMNS - EnumItemPeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(UserPeer::TYPE_ID), array(EnumItemPeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = UserPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = UserPeer::getInstanceFromPool($key1))) {
             // We no longer rehydrate the object, since this can cause data loss.
             // See http://propel.phpdb.org/trac/ticket/509
             // $obj1->hydrate($row, 0, true); // rehydrate
         } else {
             $omClass = UserPeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             UserPeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined EnumItem rows
         $key2 = EnumItemPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = EnumItemPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = EnumItemPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 EnumItemPeer::addInstanceToPool($obj2, $key2);
             }
             // if obj2 loaded
             // Add the $obj1 (User) to the collection in $obj2 (EnumItem)
             $obj2->addUser($obj1);
         }
         // if joined row not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
Ejemplo n.º 28
0
 /**
  * Gets an array of User objects which contain a foreign key that references this object.
  *
  * If this collection has already been initialized with an identical Criteria, it returns the collection.
  * Otherwise if this EnumItem has previously been saved, it will retrieve
  * related Users from storage. If this EnumItem is new, it will return
  * an empty collection or the current collection, the criteria is ignored on a new object.
  *
  * @param      PropelPDO $con
  * @param      Criteria $criteria
  * @return     array User[]
  * @throws     PropelException
  */
 public function getUsers($criteria = null, PropelPDO $con = null)
 {
     if ($criteria === null) {
         $criteria = new Criteria(EnumItemPeer::DATABASE_NAME);
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collUsers === null) {
         if ($this->isNew()) {
             $this->collUsers = array();
         } else {
             $criteria->add(UserPeer::TYPE_ID, $this->id);
             UserPeer::addSelectColumns($criteria);
             $this->collUsers = UserPeer::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(UserPeer::TYPE_ID, $this->id);
             UserPeer::addSelectColumns($criteria);
             if (!isset($this->lastUserCriteria) || !$this->lastUserCriteria->equals($criteria)) {
                 $this->collUsers = UserPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastUserCriteria = $criteria;
     return $this->collUsers;
 }
Ejemplo n.º 29
0
 /**
  * Selects a collection of Discuss objects pre-filled with all related objects except DiscussRelatedByParentId.
  *
  * @return array Array of Discuss objects.
  * @throws PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptDiscussRelatedByParentId(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);
     }
     DiscussPeer::addSelectColumns($c);
     $startcol2 = DiscussPeer::NUM_COLUMNS - DiscussPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     UserPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + UserPeer::NUM_COLUMNS;
     UserPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + UserPeer::NUM_COLUMNS;
     SchemaPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + SchemaPeer::NUM_COLUMNS;
     SchemaPropertyPeer::addSelectColumns($c);
     $startcol6 = $startcol5 + SchemaPropertyPeer::NUM_COLUMNS;
     SchemaPropertyElementPeer::addSelectColumns($c);
     $startcol7 = $startcol6 + SchemaPropertyElementPeer::NUM_COLUMNS;
     VocabularyPeer::addSelectColumns($c);
     $startcol8 = $startcol7 + VocabularyPeer::NUM_COLUMNS;
     ConceptPeer::addSelectColumns($c);
     $startcol9 = $startcol8 + ConceptPeer::NUM_COLUMNS;
     ConceptPropertyPeer::addSelectColumns($c);
     $startcol10 = $startcol9 + ConceptPropertyPeer::NUM_COLUMNS;
     $c->addJoin(DiscussPeer::CREATED_USER_ID, UserPeer::ID);
     $c->addJoin(DiscussPeer::DELETED_USER_ID, UserPeer::ID);
     $c->addJoin(DiscussPeer::SCHEMA_ID, SchemaPeer::ID);
     $c->addJoin(DiscussPeer::SCHEMA_PROPERTY_ID, SchemaPropertyPeer::ID);
     $c->addJoin(DiscussPeer::SCHEMA_PROPERTY_ELEMENT_ID, SchemaPropertyElementPeer::ID);
     $c->addJoin(DiscussPeer::VOCABULARY_ID, VocabularyPeer::ID);
     $c->addJoin(DiscussPeer::CONCEPT_ID, ConceptPeer::ID);
     $c->addJoin(DiscussPeer::CONCEPT_PROPERTY_ID, ConceptPropertyPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = DiscussPeer::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->getUserRelatedByCreatedUserId();
             //CHECKME
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addDiscussRelatedByCreatedUserId($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initDiscusssRelatedByCreatedUserId();
             $obj2->addDiscussRelatedByCreatedUserId($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->getUserRelatedByDeletedUserId();
             //CHECKME
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addDiscussRelatedByDeletedUserId($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initDiscusssRelatedByDeletedUserId();
             $obj3->addDiscussRelatedByDeletedUserId($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->addDiscuss($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initDiscusss();
             $obj4->addDiscuss($obj1);
         }
         $omClass = SchemaPropertyPeer::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->getSchemaProperty();
             //CHECKME
             if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj5->addDiscuss($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj5->initDiscusss();
             $obj5->addDiscuss($obj1);
         }
         $omClass = SchemaPropertyElementPeer::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->getSchemaPropertyElement();
             //CHECKME
             if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj6->addDiscuss($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj6->initDiscusss();
             $obj6->addDiscuss($obj1);
         }
         $omClass = VocabularyPeer::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->getVocabulary();
             //CHECKME
             if ($temp_obj7->getPrimaryKey() === $obj7->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj7->addDiscuss($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj7->initDiscusss();
             $obj7->addDiscuss($obj1);
         }
         $omClass = ConceptPeer::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->getConcept();
             //CHECKME
             if ($temp_obj8->getPrimaryKey() === $obj8->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj8->addDiscuss($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj8->initDiscusss();
             $obj8->addDiscuss($obj1);
         }
         $omClass = ConceptPropertyPeer::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->getConceptProperty();
             //CHECKME
             if ($temp_obj9->getPrimaryKey() === $obj9->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj9->addDiscuss($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj9->initDiscusss();
             $obj9->addDiscuss($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }