public static function doSelectJoinAllExceptOrientacion(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } RelAnioActividadPeer::addSelectColumns($c); $startcol2 = RelAnioActividadPeer::NUM_COLUMNS - RelAnioActividadPeer::NUM_LAZY_LOAD_COLUMNS; AnioPeer::addSelectColumns($c); $startcol3 = $startcol2 + (AnioPeer::NUM_COLUMNS - AnioPeer::NUM_LAZY_LOAD_COLUMNS); ActividadPeer::addSelectColumns($c); $startcol4 = $startcol3 + (ActividadPeer::NUM_COLUMNS - ActividadPeer::NUM_LAZY_LOAD_COLUMNS); $c->addJoin(array(RelAnioActividadPeer::FK_ANIO_ID), array(AnioPeer::ID), $join_behavior); $c->addJoin(array(RelAnioActividadPeer::FK_ACTIVIDAD_ID), array(ActividadPeer::ID), $join_behavior); $stmt = BasePeer::doSelect($c, $con); $results = array(); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key1 = RelAnioActividadPeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($obj1 = RelAnioActividadPeer::getInstanceFromPool($key1))) { } else { $omClass = RelAnioActividadPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj1 = new $cls(); $obj1->hydrate($row); RelAnioActividadPeer::addInstanceToPool($obj1, $key1); } $key2 = AnioPeer::getPrimaryKeyHashFromRow($row, $startcol2); if ($key2 !== null) { $obj2 = AnioPeer::getInstanceFromPool($key2); if (!$obj2) { $omClass = AnioPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj2 = new $cls(); $obj2->hydrate($row, $startcol2); AnioPeer::addInstanceToPool($obj2, $key2); } $obj2->addRelAnioActividad($obj1); } $key3 = ActividadPeer::getPrimaryKeyHashFromRow($row, $startcol3); if ($key3 !== null) { $obj3 = ActividadPeer::getInstanceFromPool($key3); if (!$obj3) { $omClass = ActividadPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj3 = new $cls(); $obj3->hydrate($row, $startcol3); ActividadPeer::addInstanceToPool($obj3, $key3); } $obj3->addRelAnioActividad($obj1); } $results[] = $obj1; } $stmt->closeCursor(); return $results; }
<?php $c = new Criteria(); $c->add(AnioPeer::FK_ESTABLECIMIENTO_ID, $sf_user->getAttribute('fk_establecimiento_id')); $c->addAscendingOrderByColumn(AnioPeer::DESCRIPCION); $anios = AnioPeer::doSelect($c); $optionsAnios = array(); $optionsAnios[""] = "--Seleccione un Año--"; foreach ($anios as $anio) { $optionsAnios[$anio->getId()] = $anio->getDescripcion(); } echo select_tag('anios', options_for_select($optionsAnios, $anio->getId()));
public function getAniosJoinEstablecimiento($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) { if ($criteria === null) { $criteria = new Criteria(CarreraPeer::DATABASE_NAME); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collAnios === null) { if ($this->isNew()) { $this->collAnios = array(); } else { $criteria->add(AnioPeer::FK_CARRERA_ID, $this->id); $this->collAnios = AnioPeer::doSelectJoinEstablecimiento($criteria, $con, $join_behavior); } } else { $criteria->add(AnioPeer::FK_CARRERA_ID, $this->id); if (!isset($this->lastAnioCriteria) || !$this->lastAnioCriteria->equals($criteria)) { $this->collAnios = AnioPeer::doSelectJoinEstablecimiento($criteria, $con, $join_behavior); } } $this->lastAnioCriteria = $criteria; return $this->collAnios; }
public static function retrieveByPKs($pks, PropelPDO $con = null) { if ($con === null) { $con = Propel::getConnection(AnioPeer::DATABASE_NAME, Propel::CONNECTION_READ); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(AnioPeer::DATABASE_NAME); $criteria->add(AnioPeer::ID, $pks, Criteria::IN); $objs = AnioPeer::doSelect($criteria, $con); } return $objs; }
public function getAnio(PropelPDO $con = null) { if ($this->aAnio === null && $this->fk_anio_id !== null) { $c = new Criteria(AnioPeer::DATABASE_NAME); $c->add(AnioPeer::ID, $this->fk_anio_id); $this->aAnio = AnioPeer::doSelectOne($c, $con); } return $this->aAnio; }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = AnioPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setFkEstablecimientoId($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setFkCarreraId($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setDescripcion($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setOrden($arr[$keys[4]]); } }