Returns the number of related M2P objects.

@param      Criteria $criteria
@param      boolean $distinct
@param      ConnectionInterface $con
@return int             Count of related M2P objects.
@throws PropelException
502444
public function countM2Ps(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collM2PsPartial && !$this->isNew();
        if (null === $this->collM2Ps || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collM2Ps) {
                return 0;
            }

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

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

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

        return count($this->collM2Ps);
    }
718414
public function countPictures(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collPicturesPartial && !$this->isNew();
        if (null === $this->collPictures || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collPictures) {
                return 0;
            }

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

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

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

        return count($this->collPictures);
    }
1107765
public function countDealerContactVersions(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collDealerContactVersionsPartial && !$this->isNew();
        if (null === $this->collDealerContactVersions || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collDealerContactVersions) {
                return 0;
            }

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

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

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

        return count($this->collDealerContactVersions);
    }
855103
public function countC2Ps(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collC2PsPartial && !$this->isNew();
        if (null === $this->collC2Ps || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collC2Ps) {
                return 0;
            }

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

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

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

        return count($this->collC2Ps);
    }
317239
public function countCustomerCustomerGroups(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collCustomerCustomerGroupsPartial && !$this->isNew();
        if (null === $this->collCustomerCustomerGroups || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collCustomerCustomerGroups) {
                return 0;
            }

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

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

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

        return count($this->collCustomerCustomerGroups);
    }
232731
public function countPersonFunctionI18ns(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collPersonFunctionI18nsPartial && !$this->isNew();
        if (null === $this->collPersonFunctionI18ns || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collPersonFunctionI18ns) {
                return 0;
            }

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

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

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

        return count($this->collPersonFunctionI18ns);
    }
374921
public function grabCollectionCount($collection, $criteria = [])
    {
        $collection = $this->driver->getDbh()->selectCollection($collection);
        return $collection->count($criteria);
    }
1187867
public function countDealerContacts(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collDealerContactsPartial && !$this->isNew();
        if (null === $this->collDealerContacts || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collDealerContacts) {
                return 0;
            }

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

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

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

        return count($this->collDealerContacts);
    }
985720
public function countObjects(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collObjectsPartial && !$this->isNew();
        if (null === $this->collObjects || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collObjects) {
                return 0;
            }

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

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

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

        return count($this->collObjects);
    }
1142125
public function countKstruktursRelatedBySkillId(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collKstruktursRelatedBySkillIdPartial && !$this->isNew();
        if (null === $this->collKstruktursRelatedBySkillId || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collKstruktursRelatedBySkillId) {
                return 0;
            }

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

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

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

        return count($this->collKstruktursRelatedBySkillId);
    }
149864
public static function count($criteria = array())
    {
        self::processCriteriaWithType($criteria);
        $count = self::connection()->count(self::collectionName(), $criteria);
        return $count;
    }
955498
public function countDealerAdminVersions(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collDealerAdminVersionsPartial && !$this->isNew();
        if (null === $this->collDealerAdminVersions || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collDealerAdminVersions) {
                return 0;
            }

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

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

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

        return count($this->collDealerAdminVersions);
    }
366177
public static function distinct( $key , $criteria = array() )
    {

        self::processCriteriaWithType($criteria);
        $query = array('distinct'=>self::collectionName() , 'key' => $key , 'query' => $criteria);
        return self::connection()->distinct($query);

    }
944965
public function countParts(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collPartsPartial && !$this->isNew();
        if (null === $this->collParts || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collParts) {
                return 0;
            }

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

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

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

        return count($this->collParts);
    }
1011454
public function countPages(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collPagesPartial && !$this->isNew();
        if (null === $this->collPages || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collPages) {
                return 0;
            }

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

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

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

        return count($this->collPages);
    }
869805
public function count(ConnectionInterface $con = null)
    {
        if (null === $con) {
            $con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
        }

        $this->basePreSelect($con);
        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $criteria->setDbName($this->getDbName()); // Set the correct dbName
        $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count

        // We need to set the primary table name, since in the case that there are no WHERE columns
        // it will be impossible for the createSelectSql() method to determine which
        // tables go into the FROM clause.
        $criteria->setPrimaryTableName(constant($this->modelTableMapName . '::TABLE_NAME'));

        $dataFetcher = $criteria->doCount($con);
        $row = $dataFetcher->fetch();
        if ($row) {
            $count = (int) current($row);
        } else {
            $count = 0; // no rows returned; we infer that means 0 matches.
        }
        $dataFetcher->close();

        return $count;
    }
344082
public function countSmartyFilterI18ns(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collSmartyFilterI18nsPartial && !$this->isNew();
        if (null === $this->collSmartyFilterI18ns || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collSmartyFilterI18ns) {
                return 0;
            }

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

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

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

        return count($this->collSmartyFilterI18ns);
    }