Count the total of rows

@param int $attributeId

@return int
541154
public function countTotal($attributeId)
    {
        $qb = $this->getQueryBuilder()
            ->select('COUNT(av)');

        if (!is_null($attributeId)) {
            $qb->where('av.attribute = :attribute_id')
                ->setParameter('attribute_id', $attributeId);
        }

        return $qb->getQuery()->getSingleScalarResult();
    }
231521
public function websitesCount($id)
    {
        // I know eloquent does this, but having trouble so hand crafting using DB
        $record =  DB::table('websites')->where('website_type_id', '=', $id)->get();
        return count($record);
    }
233116
public function countByFolderId($folderId)
    {
        $qb = $this->createQueryBuilder();

        $qb->field('mediaFolder.id')->equals($folderId);

        return $qb->getQuery()->count();
    }
1364479
public function count(AggregateUuid $uuid)
    {
        $sql = 'SELECT id FROM `'.PdoDriver::EVENTSTORE_TABLE_NAME.'` WHERE `uuid` = :uuid';
        $stmt = $this->connection->prepare($sql);
        $stmt->bindParam(':uuid', $uuid);
        $stmt->execute();

        return $stmt->rowCount();
    }
425990
public function countOfType(string $name): int
    {
        $oid = AttributeType::attrNameToOID($name);
        return array_sum(
            array_map(
                function (RDN $rdn) use ($oid) {
                    return count($rdn->allOf($oid));
                }, $this->_rdns));
    }
206240
public function count()
	{
		if (!empty($this->cursor) && $this->cursor instanceof \PDOStatement)
		{
			return $this->cursor->rowCount();
		}
		else
		{
			return 0;
		}
	}
1072551
public static function isReferencedByOtherImageFiles( $filepath, $attributeId )
    {
        $db = eZDB::instance();
        $filepath = $db->escapeString( $filepath );

        $rows = $db->arrayQuery(
            sprintf(
                "
                SELECT count(*) as count FROM ezcontentobject_attribute
                INNER JOIN ezimagefile ON ezcontentobject_attribute.id=ezimagefile.contentobject_attribute_id
                WHERE ezimagefile.filepath='%s'
                AND ezcontentobject_attribute.id != %d
                ",
                $filepath,
                $attributeId
            )
        );

        return (int)$rows[0]['count'] > 0;
    }
440690
public function count() {
		if(!$this->initialized)
			$this->initialize();

		return count($this->elements) - count($this->toRemove) + count($this->toAdd);
	}
805348
public function getRowCount()
    {
        $this->parseDefer();
        if(!$this->isSuccess)
        {
            throw new \RuntimeException('Result is not success!');
        }
        return count($this->statement->fetchAll());
    }
1088423
public function getTotal()
    {
        $query = $this->getQuery()->select('COUNT(*) as total');

        $rows = $this->database->query($query, $this->database->getBinds());

        if (!isset($rows[0]['total'])) {
            return 0;
        }

        return $rows[0]['total'];
    }
769187
function objectCount()
    {
        $db = eZDB::instance();

        $countRow = $db->arrayQuery( 'SELECT count(*) AS count FROM ezcontentobject '.
                                     'WHERE contentclass_id='.$this->ID ." and status = " . eZContentObject::STATUS_PUBLISHED );

        return $countRow[0]['count'];
    }
1171584
public static function getStatus($syncid) {
		if (!empty($syncid)) {
			$db = Factory::getDBO();

			$query = $db->getQuery(true)
				->select('active')
				->from('#__jfusion_sync')
				->where('syncid = ' . $db->quote($syncid));

			$db->setQuery($query);
			return (int)$db->loadResult();
		}
		return 0;
	}
929866
public function rowCount()
    {
        if (!$this->_stmt) {
            return false;
        }

        if (!$this->_executed) {
            return 0;
        }

        $num_rows = sqlsrv_rows_affected($this->_stmt);

        // Strict check is necessary; 0 is a valid return value
        if ($num_rows === false) {
            // require_once 'Zend/Db/Statement/Sqlsrv/Exception.php';
            throw new Zend_Db_Statement_Sqlsrv_Exception(sqlsrv_errors());
        }

        return $num_rows;
    }
1026101
public function findByAttributeIdAndProductId($attributeId, $productId)
    {
        try {
            $queryBuilder = $this->createQueryBuilder('productAttribute')
                ->leftJoin('productAttribute.attribute', 'attribute')
                ->leftJoin('productAttribute.product', 'product')
                ->andWhere('attribute.id = :attributeId')
                ->andWhere('product.id = :productId')
                ->setParameter('attributeId', $attributeId)
                ->setParameter('productId', $productId);

            return $queryBuilder->getQuery()->getSingleResult();
        } catch (NoResultException $exc) {
            return null;
        }
    }
1047018
public function count()
    {
        if (empty($this->queryString)) {
            $builder = clone $this->builder;
            $builder->resetQueryPart('orderBy');
            $stmt = $builder->execute();
        } else {
            $stmt = $this->connection->executeQuery($this->queryString, $this->queryParams);
        }

        return (int) $stmt->rowCount();
    }
1019580
public function countAll($select = ['id'])
    {
        $total = $this->db->select($select)->from($this->table)->execute()->rowCount();
        $this->debug->debug(__FUNCTION__, 'Total Result: ' . $total);

        return $total;
    }
543597
public static function count()
    {
        $self      = self::getInstance();

        $statement = $self->makeSelect();
        $execute   = $self->exec($statement, []);

        return $execute->rowCount();
    }