コード例 #1
0
 public function countResponsables(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
 {
     if ($criteria === null) {
         $criteria = new Criteria(NivelInstruccionPeer::DATABASE_NAME);
     } else {
         $criteria = clone $criteria;
     }
     if ($distinct) {
         $criteria->setDistinct();
     }
     $count = null;
     if ($this->collResponsables === null) {
         if ($this->isNew()) {
             $count = 0;
         } else {
             $criteria->add(ResponsablePeer::FK_NIVEL_INSTRUCCION_ID, $this->id);
             $count = ResponsablePeer::doCount($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(ResponsablePeer::FK_NIVEL_INSTRUCCION_ID, $this->id);
             if (!isset($this->lastResponsableCriteria) || !$this->lastResponsableCriteria->equals($criteria)) {
                 $count = ResponsablePeer::doCount($criteria, $con);
             } else {
                 $count = count($this->collResponsables);
             }
         } else {
             $count = count($this->collResponsables);
         }
     }
     return $count;
 }
コード例 #2
0
ファイル: BaseTipodocumento.php プロジェクト: mediasadc/alba
 public function countResponsables(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
 {
     if ($criteria === null) {
         $criteria = new Criteria(TipodocumentoPeer::DATABASE_NAME);
     } else {
         $criteria = clone $criteria;
     }
     if ($distinct) {
         $criteria->setDistinct();
     }
     $count = null;
     if ($this->collResponsables === null) {
         if ($this->isNew()) {
             $count = 0;
         } else {
             $criteria->add(ResponsablePeer::FK_TIPODOCUMENTO_ID, $this->id);
             $count = ResponsablePeer::doCount($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(ResponsablePeer::FK_TIPODOCUMENTO_ID, $this->id);
             if (!isset($this->lastResponsableCriteria) || !$this->lastResponsableCriteria->equals($criteria)) {
                 $count = ResponsablePeer::doCount($criteria, $con);
             } else {
                 $count = count($this->collResponsables);
             }
         } else {
             $count = count($this->collResponsables);
         }
     }
     return $count;
 }