コード例 #1
0
ファイル: Cursos.php プロジェクト: nagiro/hospici_cultural
 public function countMatriculesActives($idS)
 {
     $C = new Criteria();
     $C = MatriculesPeer::criteriaMatriculat($C, false);
     $C->add(MatriculesPeer::CURSOS_IDCURSOS, $this->getIdcursos());
     return MatriculesPeer::doCount($C);
 }
コード例 #2
0
ファイル: Cursos.php プロジェクト: nagiro/intra
 public function countMatriculesActives($idS)
 {
     $C = new Criteria();
     $C = MatriculesPeer::getCriteriaActiu($C, $idS);
     $C1 = $C->getNewCriterion(MatriculesPeer::ESTAT, MatriculesPeer::ACCEPTAT_NO_PAGAT);
     $C2 = $C->getNewCriterion(MatriculesPeer::ESTAT, MatriculesPeer::ACCEPTAT_PAGAT);
     $C1->addOr($C2);
     $C->add($C1);
     $C->add(MatriculesPeer::CURSOS_IDCURSOS, $this->getIdcursos());
     return MatriculesPeer::doCount($C);
 }
コード例 #3
0
ファイル: BaseCursos.php プロジェクト: nagiro/intra
 /**
  * Returns the number of related Matricules objects.
  *
  * @param      Criteria $criteria
  * @param      boolean $distinct
  * @param      PropelPDO $con
  * @return     int Count of related Matricules objects.
  * @throws     PropelException
  */
 public function countMatriculess(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
 {
     if ($criteria === null) {
         $criteria = new Criteria(CursosPeer::DATABASE_NAME);
     } else {
         $criteria = clone $criteria;
     }
     if ($distinct) {
         $criteria->setDistinct();
     }
     $count = null;
     if ($this->collMatriculess === null) {
         if ($this->isNew()) {
             $count = 0;
         } else {
             $criteria->add(MatriculesPeer::CURSOS_IDCURSOS, $this->idcursos);
             $count = MatriculesPeer::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(MatriculesPeer::CURSOS_IDCURSOS, $this->idcursos);
             if (!isset($this->lastMatriculesCriteria) || !$this->lastMatriculesCriteria->equals($criteria)) {
                 $count = MatriculesPeer::doCount($criteria, false, $con);
             } else {
                 $count = count($this->collMatriculess);
             }
         } else {
             $count = count($this->collMatriculess);
         }
     }
     return $count;
 }