/**
  * Selects a collection of Element objects pre-filled with all related objects.
  *
  * @return     array Array of Element 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);
     }
     ElementPeer::addSelectColumns($c);
     $startcol2 = ElementPeer::NUM_COLUMNS - ElementPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     ProductionPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + ProductionPeer::NUM_COLUMNS;
     $c->addJoin(ElementPeer::PRODUCTION_ID, ProductionPeer::PRODUCTION_ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = ElementPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         // Add objects for joined Production rows
         $omClass = ProductionPeer::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->getProduction();
             // CHECKME
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addElement($obj1);
                 // CHECKME
                 break;
             }
         }
         if ($newObject) {
             $obj2->initElements();
             $obj2->addElement($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
 /**
  * Selects a collection of Message objects pre-filled with all related objects except User.
  *
  * @return     array Array of Message 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);
     }
     MessagePeer::addSelectColumns($c);
     $startcol2 = MessagePeer::NUM_COLUMNS - MessagePeer::NUM_LAZY_LOAD_COLUMNS + 1;
     ProductionPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + ProductionPeer::NUM_COLUMNS;
     $c->addJoin(MessagePeer::PRODUCTION_ID, ProductionPeer::PRODUCTION_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 = ProductionPeer::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->getProduction();
             //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;
 }