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