public static function doSelectJoinAllExceptPeriodo(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } ExamenPeer::addSelectColumns($c); $startcol2 = ExamenPeer::NUM_COLUMNS - ExamenPeer::NUM_LAZY_LOAD_COLUMNS; EscalanotaPeer::addSelectColumns($c); $startcol3 = $startcol2 + (EscalanotaPeer::NUM_COLUMNS - EscalanotaPeer::NUM_LAZY_LOAD_COLUMNS); AlumnoPeer::addSelectColumns($c); $startcol4 = $startcol3 + (AlumnoPeer::NUM_COLUMNS - AlumnoPeer::NUM_LAZY_LOAD_COLUMNS); ActividadPeer::addSelectColumns($c); $startcol5 = $startcol4 + (ActividadPeer::NUM_COLUMNS - ActividadPeer::NUM_LAZY_LOAD_COLUMNS); $c->addJoin(array(ExamenPeer::FK_ESCALANOTA_ID), array(EscalanotaPeer::ID), $join_behavior); $c->addJoin(array(ExamenPeer::FK_ALUMNO_ID), array(AlumnoPeer::ID), $join_behavior); $c->addJoin(array(ExamenPeer::FK_ACTIVIDAD_ID), array(ActividadPeer::ID), $join_behavior); $stmt = BasePeer::doSelect($c, $con); $results = array(); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key1 = ExamenPeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($obj1 = ExamenPeer::getInstanceFromPool($key1))) { } else { $omClass = ExamenPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj1 = new $cls(); $obj1->hydrate($row); ExamenPeer::addInstanceToPool($obj1, $key1); } $key2 = EscalanotaPeer::getPrimaryKeyHashFromRow($row, $startcol2); if ($key2 !== null) { $obj2 = EscalanotaPeer::getInstanceFromPool($key2); if (!$obj2) { $omClass = EscalanotaPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj2 = new $cls(); $obj2->hydrate($row, $startcol2); EscalanotaPeer::addInstanceToPool($obj2, $key2); } $obj2->addExamen($obj1); } $key3 = AlumnoPeer::getPrimaryKeyHashFromRow($row, $startcol3); if ($key3 !== null) { $obj3 = AlumnoPeer::getInstanceFromPool($key3); if (!$obj3) { $omClass = AlumnoPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj3 = new $cls(); $obj3->hydrate($row, $startcol3); AlumnoPeer::addInstanceToPool($obj3, $key3); } $obj3->addExamen($obj1); } $key4 = ActividadPeer::getPrimaryKeyHashFromRow($row, $startcol4); if ($key4 !== null) { $obj4 = ActividadPeer::getInstanceFromPool($key4); if (!$obj4) { $omClass = ActividadPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj4 = new $cls(); $obj4->hydrate($row, $startcol4); ActividadPeer::addInstanceToPool($obj4, $key4); } $obj4->addExamen($obj1); } $results[] = $obj1; } $stmt->closeCursor(); return $results; }
public function getEscalanota(PropelPDO $con = null) { if ($this->aEscalanota === null && $this->fk_escalanota_id !== null) { $c = new Criteria(EscalanotaPeer::DATABASE_NAME); $c->add(EscalanotaPeer::ID, $this->fk_escalanota_id); $this->aEscalanota = EscalanotaPeer::doSelectOne($c, $con); } return $this->aEscalanota; }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = EscalanotaPeer::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->setNombre($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]]); } if (array_key_exists($keys[5], $arr)) { $this->setAprobado($arr[$keys[5]]); } }
public function countEscalanotas(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) { if ($criteria === null) { $criteria = new Criteria(EstablecimientoPeer::DATABASE_NAME); } else { $criteria = clone $criteria; } if ($distinct) { $criteria->setDistinct(); } $count = null; if ($this->collEscalanotas === null) { if ($this->isNew()) { $count = 0; } else { $criteria->add(EscalanotaPeer::FK_ESTABLECIMIENTO_ID, $this->id); $count = EscalanotaPeer::doCount($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(EscalanotaPeer::FK_ESTABLECIMIENTO_ID, $this->id); if (!isset($this->lastEscalanotaCriteria) || !$this->lastEscalanotaCriteria->equals($criteria)) { $count = EscalanotaPeer::doCount($criteria, $con); } else { $count = count($this->collEscalanotas); } } else { $count = count($this->collEscalanotas); } } return $count; }
protected function getEscalanota($establecimiento_id) { $aDatosTablaEscalaNota = array(); $criteria = new Criteria(); $criteria->add(EscalanotaPeer::FK_ESTABLECIMIENTO_ID, $establecimiento_id); $aEscalanota = EscalanotaPeer::doSelect($criteria); foreach ($aEscalanota as $escalanota) { $aDatosTablaEscalaNota[$escalanota->getNombre()] = $escalanota->getId(); } return $aDatosTablaEscalaNota; }
public static function retrieveByPKs($pks, PropelPDO $con = null) { if ($con === null) { $con = Propel::getConnection(EscalanotaPeer::DATABASE_NAME, Propel::CONNECTION_READ); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(EscalanotaPeer::DATABASE_NAME); $criteria->add(EscalanotaPeer::ID, $pks, Criteria::IN); $objs = EscalanotaPeer::doSelect($criteria, $con); } return $objs; }