コード例 #1
0
 public static function doSelectJoinAllExceptUsuario(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     LegajosaludPeer::addSelectColumns($c);
     $startcol2 = LegajosaludPeer::NUM_COLUMNS - LegajosaludPeer::NUM_LAZY_LOAD_COLUMNS;
     AlumnoPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (AlumnoPeer::NUM_COLUMNS - AlumnoPeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(LegajosaludPeer::FK_ALUMNO_ID), array(AlumnoPeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = LegajosaludPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = LegajosaludPeer::getInstanceFromPool($key1))) {
         } else {
             $omClass = LegajosaludPeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             LegajosaludPeer::addInstanceToPool($obj1, $key1);
         }
         $key2 = AlumnoPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = AlumnoPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = AlumnoPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 AlumnoPeer::addInstanceToPool($obj2, $key2);
             }
             $obj2->addLegajosalud($obj1);
         }
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
コード例 #2
0
ファイル: BaseLegajosalud.php プロジェクト: mediasadc/alba
 public function save(PropelPDO $con = null)
 {
     if ($this->isDeleted()) {
         throw new PropelException("You cannot save an object that has been deleted.");
     }
     if ($con === null) {
         $con = Propel::getConnection(LegajosaludPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
     }
     $con->beginTransaction();
     try {
         $affectedRows = $this->doSave($con);
         $con->commit();
         LegajosaludPeer::addInstanceToPool($this);
         return $affectedRows;
     } catch (PropelException $e) {
         $con->rollBack();
         throw $e;
     }
 }