Пример #1
0
 static function QuantesAvui()
 {
     $H = new Horaris();
     $C = new Criteria();
     $C->add(HorarisPeer::DIA, date('Y-m-d', time()));
     return HorarisPeer::doCount($C);
 }
Пример #2
0
 public function getNumActivitats()
 {
     $C = new Criteria();
     $C = CiclesPeer::getCriteriaActiu($C, $this->getSiteId());
     $C = ActivitatsPeer::getCriteriaActiu($C, $this->getSiteId());
     $C = HorarisPeer::getCriteriaActiu($C, $this->getSiteId());
     $C->addJoin(CiclesPeer::CICLEID, ActivitatsPeer::CICLES_CICLEID);
     $C->addJoin(ActivitatsPeer::ACTIVITATID, HorarisPeer::ACTIVITATS_ACTIVITATID);
     $C->add(CiclesPeer::CICLEID, $this->getCicleid());
     $C->addAscendingOrderByColumn(HorarisPeer::DIA);
     $C->addGroupByColumn(ActivitatsPeer::ACTIVITATID);
     return HorarisPeer::doCount($C);
 }
Пример #3
0
 /**
  * Returns the number of related Horaris objects.
  *
  * @param      Criteria $criteria
  * @param      boolean $distinct
  * @param      PropelPDO $con
  * @return     int Count of related Horaris objects.
  * @throws     PropelException
  */
 public function countHorariss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
 {
     if ($criteria === null) {
         $criteria = new Criteria(ActivitatsPeer::DATABASE_NAME);
     } else {
         $criteria = clone $criteria;
     }
     if ($distinct) {
         $criteria->setDistinct();
     }
     $count = null;
     if ($this->collHorariss === null) {
         if ($this->isNew()) {
             $count = 0;
         } else {
             $criteria->add(HorarisPeer::ACTIVITATS_ACTIVITATID, $this->activitatid);
             $count = HorarisPeer::doCount($criteria, false, $con);
         }
     } else {
         // criteria has no effect for a new object
         if (!$this->isNew()) {
             // the following code is to determine if a new query is
             // called for.  If the criteria is the same as the last
             // one, just return count of the collection.
             $criteria->add(HorarisPeer::ACTIVITATS_ACTIVITATID, $this->activitatid);
             if (!isset($this->lastHorarisCriteria) || !$this->lastHorarisCriteria->equals($criteria)) {
                 $count = HorarisPeer::doCount($criteria, false, $con);
             } else {
                 $count = count($this->collHorariss);
             }
         } else {
             $count = count($this->collHorariss);
         }
     }
     return $count;
 }