public function getLegajoadjuntos($criteria = null, PropelPDO $con = null) { if ($criteria === null) { $criteria = new Criteria(AdjuntoPeer::DATABASE_NAME); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collLegajoadjuntos === null) { if ($this->isNew()) { $this->collLegajoadjuntos = array(); } else { $criteria->add(LegajoadjuntoPeer::FK_ADJUNTO_ID, $this->id); LegajoadjuntoPeer::addSelectColumns($criteria); $this->collLegajoadjuntos = LegajoadjuntoPeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(LegajoadjuntoPeer::FK_ADJUNTO_ID, $this->id); LegajoadjuntoPeer::addSelectColumns($criteria); if (!isset($this->lastLegajoadjuntoCriteria) || !$this->lastLegajoadjuntoCriteria->equals($criteria)) { $this->collLegajoadjuntos = LegajoadjuntoPeer::doSelect($criteria, $con); } } } $this->lastLegajoadjuntoCriteria = $criteria; return $this->collLegajoadjuntos; }
public static function doSelectJoinAllExceptAdjunto(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } LegajoadjuntoPeer::addSelectColumns($c); $startcol2 = LegajoadjuntoPeer::NUM_COLUMNS - LegajoadjuntoPeer::NUM_LAZY_LOAD_COLUMNS; LegajopedagogicoPeer::addSelectColumns($c); $startcol3 = $startcol2 + (LegajopedagogicoPeer::NUM_COLUMNS - LegajopedagogicoPeer::NUM_LAZY_LOAD_COLUMNS); $c->addJoin(array(LegajoadjuntoPeer::FK_LEGAJOPEDAGOGICO_ID), array(LegajopedagogicoPeer::ID), $join_behavior); $stmt = BasePeer::doSelect($c, $con); $results = array(); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key1 = LegajoadjuntoPeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($obj1 = LegajoadjuntoPeer::getInstanceFromPool($key1))) { } else { $omClass = LegajoadjuntoPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj1 = new $cls(); $obj1->hydrate($row); LegajoadjuntoPeer::addInstanceToPool($obj1, $key1); } $key2 = LegajopedagogicoPeer::getPrimaryKeyHashFromRow($row, $startcol2); if ($key2 !== null) { $obj2 = LegajopedagogicoPeer::getInstanceFromPool($key2); if (!$obj2) { $omClass = LegajopedagogicoPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj2 = new $cls(); $obj2->hydrate($row, $startcol2); LegajopedagogicoPeer::addInstanceToPool($obj2, $key2); } $obj2->addLegajoadjunto($obj1); } $results[] = $obj1; } $stmt->closeCursor(); return $results; }