Counts the number of instances that exists of the identified type.

@param int $typeId

@return int
351269
public function countInstancesOfType($typeId)
    {
        $q = $this->dbHandler->createSelectQuery();
        $q->select(
            $q->alias(
                $q->expr->count(
                    $this->dbHandler->quoteColumn('id')
                ),
                'count'
            )
        )->from(
            $this->dbHandler->quoteTable('ezcontentobject')
        )->where(
            $q->expr->eq(
                $this->dbHandler->quoteColumn('contentclass_id'),
                $q->bindValue($typeId, null, \PDO::PARAM_INT)
            )
        );

        $stmt = $q->prepare();
        $stmt->execute();

        return (int)$stmt->fetchColumn();
    }
700807
public function pageType($typeOrId)
    {
        $this->pageTypeId = $typeOrId instanceof PageType ? $typeOrId->getId() : $typeOrId;
        $this->query->where('page_type', $this->pageTypeId);
        return $this;
    }
525891
public function setTypeId( $typeid )
	{
		if ( $typeid == $this->getTypeId() ) { return; }

		$this->_values['typeid'] = (int) $typeid;
		$this->setModified();
	}
1003013
public function deleteTracks(string $typeName, ?int $typeId = null, ?int $expiryTime = 0, int $trackableType = Tracker::TRACKER_LIVE) : int
    {
        $query = $this->getModel()
            ->newQuery()
            ->where('type', $this->getAlias($typeName));

        if ($typeId !== -1) {
            $query->where('type_id', $typeId);
        }

        if ($expiryTime !== null && $expiryTime > 0) {
            $query->whereRaw('(TIMESTAMPDIFF(MINUTE, created_at, NOW()) >= ?)', $expiryTime);
        }

        $query->where($this->typeClosure($trackableType));

        return $query->delete();
    }
489502
public function countByRootPageId(int $rootPageId): int
    {
        $queryBuilder = $this->getQueryBuilder();
        return (int)$this->getQueryBuilder()
            ->count('*')
            ->from($this->table)
            ->andWhere($queryBuilder->expr()->eq('root_pid', $rootPageId))
            ->execute()->fetchColumn(0);
    }
117383
@Override
    public long count(String type) {
        if ((type != null) && (!type.isEmpty()) && (!UNDEFINED.equalsIgnoreCase(type))) {
            return dashboardRepository.countByTypeContainingIgnoreCase(type);
        } else {
            return dashboardRepository.count();
        }
    }
810731
private static function getNumberOfPKs($type) {
    if (!isset(self::$numPkKeys[$type])) {
      $numPKs = 1;
      $persistenceFacade = ObjectFactory::getInstance('persistenceFacade');
      if ($persistenceFacade->isKnownType($type)) {
        $mapper = $persistenceFacade->getMapper($type);
        $numPKs = sizeof($mapper->getPKNames());
      }
      self::$numPkKeys[$type] = $numPKs;
    }
    return self::$numPkKeys[$type];
  }
24468
public function getTypeCount($indexName, $typeName, $query = '')
    {
        $index = $this->getIndex($indexName);
        $type = $index->getType($typeName);

        return $type->count($query);
    }
210256
public function insertType(Type $type, $typeId = null)
    {
        $q = $this->dbHandler->createInsertQuery();
        $q->insertInto($this->dbHandler->quoteTable('ezcontentclass'));
        $q->set(
            $this->dbHandler->quoteColumn('id'),
            isset($typeId) ? $q->bindValue($typeId, null, \PDO::PARAM_INT) : $this->dbHandler->getAutoIncrementValue('ezcontentclass', 'id')
        )->set(
            $this->dbHandler->quoteColumn('version'),
            $q->bindValue($type->status, null, \PDO::PARAM_INT)
        )->set(
            $this->dbHandler->quoteColumn('created'),
            $q->bindValue($type->created, null, \PDO::PARAM_INT)
        )->set(
            $this->dbHandler->quoteColumn('creator_id'),
            $q->bindValue($type->creatorId, null, \PDO::PARAM_INT)
        );
        $this->setCommonTypeColumns($q, $type);

        $q->prepare()->execute();

        if (empty($typeId)) {
            $typeId = $this->dbHandler->lastInsertId(
                $this->dbHandler->getSequenceName('ezcontentclass', 'id')
            );
        }

        $this->insertTypeNameData($typeId, $type->status, $type->name);

        return $typeId;
    }
83192
public function count(AggregateUuid $uuid)
    {
        return (isset($this->events[(string) $uuid])) ? count($this->events[(string) $uuid]) : 0;
    }
1161184
public static function count_courses_using_competency($competencyid) {
        $params = self::validate_parameters(self::count_courses_using_competency_parameters(), array(
            'id' => $competencyid,
        ));

        $competency = api::read_competency($params['id']);
        self::validate_context($competency->get_context());

        return api::count_courses_using_competency($params['id']);
    }
1214335
public function get_pod_type_count( $type ) {

		$args = array(
			'post_type'      => '_pods_pod',
			'posts_per_page' => - 1,
			'nopaging'       => true,
			'fields'         => 'ids',
			'meta_query'     => array(
				array(
					'key'   => 'type',
					'value' => $type,
				),
			),
		);

		$posts = get_posts( $args );

		$total = count( $posts );

		return $total;

	}
741858
public function count($type='admin.web')
    {
        return $this->task->scopeQuery(function($query)use($type){
                return $query->whereUserId(user_id($type))
                            ->whereUserType(user_type($type));
            })->count();
    }
801331
public function setTypeId($typeId)
    {
        if (!in_array($typeId, array(self::SEASON_PDF_GENERATION_TYPE, self::AREA_PDF_GENERATION_TYPE))) {
            throw new \InvalidArgumentException("Invalid typeId");
        }
        $this->typeId = $typeId;

        return $this;
    }
548860
public function loadGroup($groupId)
    {
        $groups = $this->mapper->extractGroupsFromRows(
            $this->contentTypeGateway->loadGroupData([$groupId])
        );

        if (count($groups) !== 1) {
            throw new Exception\TypeGroupNotFound($groupId);
        }

        return $groups[0];
    }
1137962
public function count($siteId, $type = null, $foldersId = null)
    {
        $qa = $this->createAggregationQuery();
        $qa->match(array('siteId' => $siteId));
        if (null !== $type) {
            $qa->match(array('mediaType' => $type));
        }
        if (null !== $foldersId) {
            $qa->match($this->generateFilterMediaPerimeter($foldersId));
        }

        return $this->countDocumentAggregateQuery($qa);
    }
176185
public function Master_Get_Count($masterId) {
        $ret = false;

        if (is_int($masterId) === true) {
            do {
                $ret = $this->_call_api('get', "{$this->_url}/masters/$masterId/countData", array());
                // Sleep for 15 seconds so we don't keep hammering the api
                sleep(15);
            }
            while (!$this->Status_Is_Completed($ret->status));
        }

        return $ret;
    }