Example #1
0
 /**
  * Returns the number of related Asistencias objects.
  *
  * @param      Criteria $criteria
  * @param      boolean $distinct
  * @param      PropelPDO $con
  * @return     int Count of related Asistencias objects.
  * @throws     PropelException
  */
 public function countAsistenciass(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
 {
     if ($criteria === null) {
         $criteria = new Criteria(AspirantesPeer::DATABASE_NAME);
     } else {
         $criteria = clone $criteria;
     }
     if ($distinct) {
         $criteria->setDistinct();
     }
     $count = null;
     if ($this->collAsistenciass === null) {
         if ($this->isNew()) {
             $count = 0;
         } else {
             $criteria->add(AsistenciasPeer::ASPIRANTES_ID, $this->id);
             $count = AsistenciasPeer::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(AsistenciasPeer::ASPIRANTES_ID, $this->id);
             if (!isset($this->lastAsistenciasCriteria) || !$this->lastAsistenciasCriteria->equals($criteria)) {
                 $count = AsistenciasPeer::doCount($criteria, false, $con);
             } else {
                 $count = count($this->collAsistenciass);
             }
         } else {
             $count = count($this->collAsistenciass);
         }
     }
     return $count;
 }
Example #2
0
 public static function count($evaluacion)
 {
     $criteria = new Criteria();
     $criteria->add(AsistenciasPeer::EVALUACIONES_ID, $evaluacion, Criteria::EQUAL);
     return AsistenciasPeer::doCount($criteria);
 }