/**
  * Add all the columns needed to create a new object.
  *
  * Note: any columns that were marked with lazyLoad="true" in the
  * XML schema will not be added to the select list and only loaded
  * on demand.
  *
  * @param      criteria object containing the columns to add.
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function addSelectColumns(Criteria $criteria, $tableAlias = null)
 {
     $criteria->addSelectColumn($tableAlias ? ProfilePeer::alias($tableAlias, ProfilePeer::ID) : ProfilePeer::ID);
     $criteria->addSelectColumn($tableAlias ? ProfilePeer::alias($tableAlias, ProfilePeer::AGENT_ID) : ProfilePeer::AGENT_ID);
     $criteria->addSelectColumn($tableAlias ? ProfilePeer::alias($tableAlias, ProfilePeer::CREATED_AT) : ProfilePeer::CREATED_AT);
     $criteria->addSelectColumn($tableAlias ? ProfilePeer::alias($tableAlias, ProfilePeer::UPDATED_AT) : ProfilePeer::UPDATED_AT);
     $criteria->addSelectColumn($tableAlias ? ProfilePeer::alias($tableAlias, ProfilePeer::DELETED_AT) : ProfilePeer::DELETED_AT);
     $criteria->addSelectColumn($tableAlias ? ProfilePeer::alias($tableAlias, ProfilePeer::CREATED_BY) : ProfilePeer::CREATED_BY);
     $criteria->addSelectColumn($tableAlias ? ProfilePeer::alias($tableAlias, ProfilePeer::UPDATED_BY) : ProfilePeer::UPDATED_BY);
     $criteria->addSelectColumn($tableAlias ? ProfilePeer::alias($tableAlias, ProfilePeer::DELETED_BY) : ProfilePeer::DELETED_BY);
     $criteria->addSelectColumn($tableAlias ? ProfilePeer::alias($tableAlias, ProfilePeer::CHILD_UPDATED_AT) : ProfilePeer::CHILD_UPDATED_AT);
     $criteria->addSelectColumn($tableAlias ? ProfilePeer::alias($tableAlias, ProfilePeer::CHILD_UPDATED_BY) : ProfilePeer::CHILD_UPDATED_BY);
     $criteria->addSelectColumn($tableAlias ? ProfilePeer::alias($tableAlias, ProfilePeer::NAME) : ProfilePeer::NAME);
     $criteria->addSelectColumn($tableAlias ? ProfilePeer::alias($tableAlias, ProfilePeer::NOTE) : ProfilePeer::NOTE);
     $criteria->addSelectColumn($tableAlias ? ProfilePeer::alias($tableAlias, ProfilePeer::URI) : ProfilePeer::URI);
     $criteria->addSelectColumn($tableAlias ? ProfilePeer::alias($tableAlias, ProfilePeer::URL) : ProfilePeer::URL);
     $criteria->addSelectColumn($tableAlias ? ProfilePeer::alias($tableAlias, ProfilePeer::BASE_DOMAIN) : ProfilePeer::BASE_DOMAIN);
     $criteria->addSelectColumn($tableAlias ? ProfilePeer::alias($tableAlias, ProfilePeer::TOKEN) : ProfilePeer::TOKEN);
     $criteria->addSelectColumn($tableAlias ? ProfilePeer::alias($tableAlias, ProfilePeer::COMMUNITY) : ProfilePeer::COMMUNITY);
     $criteria->addSelectColumn($tableAlias ? ProfilePeer::alias($tableAlias, ProfilePeer::LAST_URI_ID) : ProfilePeer::LAST_URI_ID);
     $criteria->addSelectColumn($tableAlias ? ProfilePeer::alias($tableAlias, ProfilePeer::STATUS_ID) : ProfilePeer::STATUS_ID);
     $criteria->addSelectColumn($tableAlias ? ProfilePeer::alias($tableAlias, ProfilePeer::LANGUAGE) : ProfilePeer::LANGUAGE);
 }
 /**
  * Selects a collection of ProfileProperty objects pre-filled with all related objects.
  *
  * @return array Array of ProfileProperty 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);
     }
     ProfilePropertyPeer::addSelectColumns($c);
     $startcol2 = ProfilePropertyPeer::NUM_COLUMNS - ProfilePropertyPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     UserPeer::addSelectColumns($c, 'a1');
     $startcol3 = $startcol2 + UserPeer::NUM_COLUMNS;
     $c->addJoin(ProfilePropertyPeer::CREATED_BY, UserPeer::alias('a1', UserPeer::ID));
     $c->addAlias('a1', UserPeer::TABLE_NAME);
     UserPeer::addSelectColumns($c, 'a2');
     $startcol4 = $startcol3 + UserPeer::NUM_COLUMNS;
     $c->addJoin(ProfilePropertyPeer::UPDATED_BY, UserPeer::alias('a2', UserPeer::ID));
     $c->addAlias('a2', UserPeer::TABLE_NAME);
     UserPeer::addSelectColumns($c, 'a3');
     $startcol5 = $startcol4 + UserPeer::NUM_COLUMNS;
     $c->addJoin(ProfilePropertyPeer::DELETED_BY, UserPeer::alias('a3', UserPeer::ID));
     $c->addAlias('a3', UserPeer::TABLE_NAME);
     ProfilePeer::addSelectColumns($c, 'a4');
     $startcol6 = $startcol5 + ProfilePeer::NUM_COLUMNS;
     $c->addJoin(ProfilePropertyPeer::PROFILE_ID, ProfilePeer::alias('a4', ProfilePeer::ID));
     $c->addAlias('a4', ProfilePeer::TABLE_NAME);
     StatusPeer::addSelectColumns($c, 'a5');
     $startcol7 = $startcol6 + StatusPeer::NUM_COLUMNS;
     $c->addJoin(ProfilePropertyPeer::STATUS_ID, StatusPeer::alias('a5', StatusPeer::ID));
     $c->addAlias('a5', StatusPeer::TABLE_NAME);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = ProfilePropertyPeer::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->getUserRelatedByCreatedBy();
             // CHECKME
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addProfilePropertyRelatedByCreatedBy($obj1);
                 // CHECKME
                 break;
             }
         }
         if ($newObject) {
             $obj2->initProfilePropertysRelatedByCreatedBy();
             $obj2->addProfilePropertyRelatedByCreatedBy($obj1);
         }
         // Add objects for joined User rows
         $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->getUserRelatedByUpdatedBy();
             // CHECKME
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addProfilePropertyRelatedByUpdatedBy($obj1);
                 // CHECKME
                 break;
             }
         }
         if ($newObject) {
             $obj3->initProfilePropertysRelatedByUpdatedBy();
             $obj3->addProfilePropertyRelatedByUpdatedBy($obj1);
         }
         // Add objects for joined User rows
         $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->getUserRelatedByDeletedBy();
             // CHECKME
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addProfilePropertyRelatedByDeletedBy($obj1);
                 // CHECKME
                 break;
             }
         }
         if ($newObject) {
             $obj4->initProfilePropertysRelatedByDeletedBy();
             $obj4->addProfilePropertyRelatedByDeletedBy($obj1);
         }
         // Add objects for joined Profile rows
         $omClass = ProfilePeer::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->getProfile();
             // CHECKME
             if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj5->addProfileProperty($obj1);
                 // CHECKME
                 break;
             }
         }
         if ($newObject) {
             $obj5->initProfilePropertys();
             $obj5->addProfileProperty($obj1);
         }
         // Add objects for joined Status rows
         $omClass = StatusPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj6 = new $cls();
         $obj6->hydrate($rs, $startcol6);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj6 = $temp_obj1->getStatus();
             // CHECKME
             if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj6->addProfileProperty($obj1);
                 // CHECKME
                 break;
             }
         }
         if ($newObject) {
             $obj6->initProfilePropertys();
             $obj6->addProfileProperty($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }