@param Criteria $criteria

@return int
435836
public function countByCriteria(Criteria $criteria)
    {
        $qb = $this->createCriteriaQueryBuilder($criteria, 'm');

        $qb->select('COUNT(m.id)');

        return $qb->getQuery()->getSingleScalarResult();
    }
1167078
public function countMxmaps(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collMxmapsPartial && !$this->isNew();
        if (null === $this->collMxmaps || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collMxmaps) {
                return 0;
            }

            if ($partial && !$criteria) {
                return count($this->getMxmaps());
            }

            $query = ChildMxmapQuery::create(null, $criteria);
            if ($distinct) {
                $query->distinct();
            }

            return $query
                ->filterByMap($this)
                ->count($con);
        }

        return count($this->collMxmaps);
    }
365879
public function matching(Criteria $criteria)
    {
        $allEntities = $this->wrapped->findAll();
        $collection = new ArrayCollection($allEntities);

        return $collection->matching($criteria);
    }
116816
public function countCustomerGroupI18ns(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collCustomerGroupI18nsPartial && !$this->isNew();
        if (null === $this->collCustomerGroupI18ns || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collCustomerGroupI18ns) {
                return 0;
            }

            if ($partial && !$criteria) {
                return count($this->getCustomerGroupI18ns());
            }

            $query = ChildCustomerGroupI18nQuery::create(null, $criteria);
            if ($distinct) {
                $query->distinct();
            }

            return $query
                ->filterByCustomerGroup($this)
                ->count($con);
        }

        return count($this->collCustomerGroupI18ns);
    }
1173083
public function countDealerContentVersions(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collDealerContentVersionsPartial && !$this->isNew();
        if (null === $this->collDealerContentVersions || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collDealerContentVersions) {
                return 0;
            }

            if ($partial && !$criteria) {
                return count($this->getDealerContentVersions());
            }

            $query = ChildDealerContentVersionQuery::create(null, $criteria);
            if ($distinct) {
                $query->distinct();
            }

            return $query
                ->filterByDealerContent($this)
                ->count($con);
        }

        return count($this->collDealerContentVersions);
    }
503077
public function countDealerShedulesVersions(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collDealerShedulesVersionsPartial && !$this->isNew();
        if (null === $this->collDealerShedulesVersions || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collDealerShedulesVersions) {
                return 0;
            }

            if ($partial && !$criteria) {
                return count($this->getDealerShedulesVersions());
            }

            $query = ChildDealerShedulesVersionQuery::create(null, $criteria);
            if ($distinct) {
                $query->distinct();
            }

            return $query
                ->filterByDealerShedules($this)
                ->count($con);
        }

        return count($this->collDealerShedulesVersions);
    }
1009964
public function countPersonI18ns(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collPersonI18nsPartial && !$this->isNew();
        if (null === $this->collPersonI18ns || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collPersonI18ns) {
                return 0;
            }

            if ($partial && !$criteria) {
                return count($this->getPersonI18ns());
            }

            $query = ChildPersonI18nQuery::create(null, $criteria);
            if ($distinct) {
                $query->distinct();
            }

            return $query
                ->filterByPerson($this)
                ->count($con);
        }

        return count($this->collPersonI18ns);
    }
516747
public function countApiLogs(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
    {
        $partial = $this->collApiLogsPartial && !$this->isNew();
        if (null === $this->collApiLogs || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collApiLogs) {
                return 0;
            }

            if ($partial && !$criteria) {
                return count($this->getApiLogs());
            }
            $query = ApiLogQuery::create(null, $criteria);
            if ($distinct) {
                $query->distinct();
            }

            return $query
                ->filterByRemoteApp($this)
                ->count($con);
        }

        return count($this->collApiLogs);
    }
964230
public function countFeatureTypeI18ns(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collFeatureTypeI18nsPartial && !$this->isNew();
        if (null === $this->collFeatureTypeI18ns || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collFeatureTypeI18ns) {
                return 0;
            }

            if ($partial && !$criteria) {
                return count($this->getFeatureTypeI18ns());
            }

            $query = ChildFeatureTypeI18nQuery::create(null, $criteria);
            if ($distinct) {
                $query->distinct();
            }

            return $query
                ->filterByFeatureType($this)
                ->count($con);
        }

        return count($this->collFeatureTypeI18ns);
    }
694074
public function countDealerSheduless(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collDealerShedulessPartial && !$this->isNew();
        if (null === $this->collDealerSheduless || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collDealerSheduless) {
                return 0;
            }

            if ($partial && !$criteria) {
                return count($this->getDealerSheduless());
            }

            $query = ChildDealerShedulesQuery::create(null, $criteria);
            if ($distinct) {
                $query->distinct();
            }

            return $query
                ->filterByDealer($this)
                ->count($con);
        }

        return count($this->collDealerSheduless);
    }
1009585
private function getLimitSql(Criteria $criteria)
    {
        $limit  = $criteria->getMaxResults();
        $offset = $criteria->getFirstResult();
        if ($limit !== null || $offset !== null) {
            return $this->platform->modifyLimitQuery('', $limit, $offset ?? 0);
        }

        return '';
    }
904685
public Long count(Criteria<T, T> criteria) {
        SingularAttribute<? super T, PK> id = getEntityManager().getMetamodel().entity(entityClass).getId(entityKey);
        return criteria.select(Long.class, countDistinct(id))
                .getSingleResult();
    }
958328
public function count($criteria=null)
	{
		$query=new CJoinQuery($this,$criteria);
		// ensure only one big join statement is used
		$this->_finder->baseLimited=false;
		$this->_finder->joinAll=true;
		$this->buildQuery($query);

		$query->limit=$query->offset=-1;

		if(!empty($criteria->group) || !empty($criteria->having))
		{
			$query->orders = array();
			$command=$query->createCommand($this->_builder);
			$sql=$command->getText();
			$sql="SELECT COUNT(*) FROM ({$sql}) sq";
			$command->setText($sql);
			$command->params=$query->params;
			return $command->queryScalar();
		}
		else
		{
			$select=is_array($criteria->select) ? implode(',',$criteria->select) : $criteria->select;
			if($select!=='*' && preg_match('/^count\s*\(/i',trim($select)))
				$query->selects=array($select);
			elseif(is_string($this->_table->primaryKey))
			{
				$prefix=$this->getColumnPrefix();
				$schema=$this->_builder->getSchema();
				$column=$prefix.$schema->quoteColumnName($this->_table->primaryKey);
				$query->selects=array("COUNT(DISTINCT $column)");
			}
			else
				$query->selects=array("COUNT(*)");

			$query->orders=$query->groups=$query->havings=array();
			$command=$query->createCommand($this->_builder);
			return $command->queryScalar();
		}
	}
42104
protected function getSelectConditionCriteriaSQL(Criteria $criteria)
    {
        $expression = $criteria->getWhereExpression();

        if ($expression === null) {
            return '';
        }

        $visitor = new SqlExpressionVisitor($this, $this->class);

        return $visitor->dispatch($expression);
    }
1004546
public function countChildren(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collChildrenPartial && !$this->isNew();
        if (null === $this->collChildren || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collChildren) {
                return 0;
            }

            if ($partial && !$criteria) {
                return count($this->getChildren());
            }

            $query = ChildSkillDependencyQuery::create(null, $criteria);
            if ($distinct) {
                $query->distinct();
            }

            return $query
                ->filterBySkillRelatedByDependencyId($this)
                ->count($con);
        }

        return count($this->collChildren);
    }
1142089
public function countDealerProductVersions(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collDealerProductVersionsPartial && !$this->isNew();
        if (null === $this->collDealerProductVersions || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collDealerProductVersions) {
                return 0;
            }

            if ($partial && !$criteria) {
                return count($this->getDealerProductVersions());
            }

            $query = ChildDealerProductVersionQuery::create(null, $criteria);
            if ($distinct) {
                $query->distinct();
            }

            return $query
                ->filterByDealerProduct($this)
                ->count($con);
        }

        return count($this->collDealerProductVersions);
    }
716522
public function countDescendants(Criteria $criteria = null, ConnectionInterface $con = null)
    {
        if ($this->isLeaf()) {
            // save one query
            return 0;
        } else {
            return ChildCategoryQuery::create(null, $criteria)
                ->descendantsOf($this)
                ->count($con);
        }
    }