示例#1
0
 public function countsfGuardUserProfiles($criteria = null, $distinct = false, $con = null)
 {
     include_once 'lib/model/om/BasesfGuardUserProfilePeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     $criteria->add(sfGuardUserProfilePeer::USER_ID, $this->getId());
     return sfGuardUserProfilePeer::doCount($criteria, $distinct, $con);
 }
示例#2
0
 /**
  * Returns the number of related sfGuardUserProfile objects.
  *
  * @param      Criteria $criteria
  * @param      boolean $distinct
  * @param      PropelPDO $con
  * @return     int Count of related sfGuardUserProfile objects.
  * @throws     PropelException
  */
 public function countsfGuardUserProfiles(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
 {
     if ($criteria === null) {
         $criteria = new Criteria(UserTypePeer::DATABASE_NAME);
     } else {
         $criteria = clone $criteria;
     }
     if ($distinct) {
         $criteria->setDistinct();
     }
     $count = null;
     if ($this->collsfGuardUserProfiles === null) {
         if ($this->isNew()) {
             $count = 0;
         } else {
             $criteria->add(sfGuardUserProfilePeer::USER_TYPE_ID, $this->id);
             $count = sfGuardUserProfilePeer::doCount($criteria, $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(sfGuardUserProfilePeer::USER_TYPE_ID, $this->id);
             if (!isset($this->lastsfGuardUserProfileCriteria) || !$this->lastsfGuardUserProfileCriteria->equals($criteria)) {
                 $count = sfGuardUserProfilePeer::doCount($criteria, $con);
             } else {
                 $count = count($this->collsfGuardUserProfiles);
             }
         } else {
             $count = count($this->collsfGuardUserProfiles);
         }
     }
     return $count;
 }