Example #1
0
 public function getConceptosArray()
 {
     $optionsConcepto = array();
     $criteria = new Criteria();
     $criteria->add(ConceptoPeer::FK_ESTABLECIMIENTO_ID, $this->getId());
     $conceptos = ConceptoPeer::doSelect($criteria);
     foreach ($conceptos as $concepto) {
         $optionsConcepto[$concepto->getId()] = $concepto->getNombre();
     }
     return $optionsConcepto;
 }
Example #2
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = ConceptoPeer::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]]);
     }
 }
 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);
     }
     BoletinConceptualPeer::addSelectColumns($c);
     $startcol2 = BoletinConceptualPeer::NUM_COLUMNS - BoletinConceptualPeer::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);
     ConceptoPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + (ConceptoPeer::NUM_COLUMNS - ConceptoPeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(BoletinConceptualPeer::FK_ESCALANOTA_ID), array(EscalanotaPeer::ID), $join_behavior);
     $c->addJoin(array(BoletinConceptualPeer::FK_ALUMNO_ID), array(AlumnoPeer::ID), $join_behavior);
     $c->addJoin(array(BoletinConceptualPeer::FK_CONCEPTO_ID), array(ConceptoPeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = BoletinConceptualPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = BoletinConceptualPeer::getInstanceFromPool($key1))) {
         } else {
             $omClass = BoletinConceptualPeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             BoletinConceptualPeer::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->addBoletinConceptual($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->addBoletinConceptual($obj1);
         }
         $key4 = ConceptoPeer::getPrimaryKeyHashFromRow($row, $startcol4);
         if ($key4 !== null) {
             $obj4 = ConceptoPeer::getInstanceFromPool($key4);
             if (!$obj4) {
                 $omClass = ConceptoPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj4 = new $cls();
                 $obj4->hydrate($row, $startcol4);
                 ConceptoPeer::addInstanceToPool($obj4, $key4);
             }
             $obj4->addBoletinConceptual($obj1);
         }
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
Example #4
0
 public static function retrieveByPKs($pks, PropelPDO $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(ConceptoPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria(ConceptoPeer::DATABASE_NAME);
         $criteria->add(ConceptoPeer::ID, $pks, Criteria::IN);
         $objs = ConceptoPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Example #5
0
 public function countConceptos(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->collConceptos === null) {
         if ($this->isNew()) {
             $count = 0;
         } else {
             $criteria->add(ConceptoPeer::FK_ESTABLECIMIENTO_ID, $this->id);
             $count = ConceptoPeer::doCount($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(ConceptoPeer::FK_ESTABLECIMIENTO_ID, $this->id);
             if (!isset($this->lastConceptoCriteria) || !$this->lastConceptoCriteria->equals($criteria)) {
                 $count = ConceptoPeer::doCount($criteria, $con);
             } else {
                 $count = count($this->collConceptos);
             }
         } else {
             $count = count($this->collConceptos);
         }
     }
     return $count;
 }
Example #6
0
 public function getConcepto(PropelPDO $con = null)
 {
     if ($this->aConcepto === null && $this->fk_concepto_id !== null) {
         $c = new Criteria(ConceptoPeer::DATABASE_NAME);
         $c->add(ConceptoPeer::ID, $this->fk_concepto_id);
         $this->aConcepto = ConceptoPeer::doSelectOne($c, $con);
     }
     return $this->aConcepto;
 }