/**
  * 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;
 }
 /**
  * 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)
 {
     foreach (sfMixer::getCallables('BaseAgentPeer:addDoSelectRS:addDoSelectRS') as $callable) {
         call_user_func($callable, 'BaseAgentPeer', $criteria, $con);
     }
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     if (!$criteria->getSelectColumns()) {
         $criteria = clone $criteria;
         AgentPeer::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);
 }
 /**
  * Selects a collection of AgentHasUser objects pre-filled with all related objects except User.
  *
  * @return array Array of AgentHasUser objects.
  * @throws PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptUser(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);
     }
     AgentHasUserPeer::addSelectColumns($c);
     $startcol2 = AgentHasUserPeer::NUM_COLUMNS - AgentHasUserPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     AgentPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + AgentPeer::NUM_COLUMNS;
     $c->addJoin(AgentHasUserPeer::AGENT_ID, AgentPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = AgentHasUserPeer::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->addAgentHasUser($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initAgentHasUsers();
             $obj2->addAgentHasUser($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }