get AppointmentsCount.

@return int Count of Appointments held by this Contact
164372
public function getAppointmentsCountAttribute()
    {
        // If relation is not loaded already, let's do it first
        if (!array_key_exists('appointmentsCount', $this->relations)) {
            $this->load('appointmentsCount');
        }

        $related = $this->getRelation('appointmentsCount');

        // Return the count directly
        return ($related->count() > 0) ? (int) $related->first()->aggregate : 0;
    }
613478
public function getContactIds()
    {
        $list = array();
        foreach ($this->contacts as $contact) {
            $list[$contact->name] = $contact->id;
        }

        return $list;
    }
1371997
public function count()
    {
        return ( self::$assigned[$this->type] - self::START_AT + self::INCREMENT ) / self::INCREMENT;
    }
332697
public function getNextNumber()
    {
        if (0 === (int) $this->countTotal()) {
            return 1;
        }

        $qb = $this->getQueryBuilder()
            ->select('MAX(i.invoiceNumber) + 1');

        return $qb->getQuery()
            ->getSingleScalarResult();
    }
773994
public function contactableAttendees() {
		$attendees = $this->Attendees();
		foreach ($this->stat("registrant_fields") as $field) {
			$attendees = $attendees->where("\"".$field."\" IS NOT NULL");
		}
		return $attendees;
	}
235412
public function count()
    {
        if ($this->countCached === null) {
            $pageSize = $this->pageSize;
            $this->pageSize = 1;
            $this->makeQuery(1);
            $this->pageSize = $pageSize;
        }

        return $this->countCached;
    }
1336681
public function getReplacedCount(): int
    {
        return intval(array_reduce(
            $this->fieldResultList,
            function (int $count, FieldReplaceResult $fieldResult) {
                return $count + $fieldResult->getReplacedCount();
            },
            0
        ));
    }
750961
public function getCounts()
    {
        return array(
            'habbo' => count($this->habbo),
            'badges' => count($this->badges),
            'friends' => count($this->friends),
            'groups' => count($this->groups),
            'rooms' => count($this->rooms),
        );
    }
1280351
public function rowCount()
    {
        try {
            if ($this->stmt) {
                return $this->stmt->rowCount();
            }
            return null;
        } catch (\PDOException $e) {
            die("Error: " . $e->getMessage());
        }
    }
431514
public function count()
    {
        $this->countQuery->execute();
        $res = $this->countQuery->fetchColumn();
        $this->countQuery->closeCursor();
        return (int) $res;
    }
821910
public function getVoucherDiscount()
    {
        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_showVouchers')) {
            return $this->_oVoucherDiscount;
        }

        return null;
    }
620802
private function _count()
    {
        if ($this->group_id)
            $join = " LEFT JOIN " . $this->db->table_name($this->db_groupmembers, true) . " AS m".
                " ON (m.`contact_id` = c.`".$this->primary_key."`)";

        // count contacts for this user
        $sql_result = $this->db->query(
            "SELECT COUNT(c.`contact_id`) AS cnt".
            " FROM " . $this->db->table_name($this->db_name, true) . " AS c".
                $join.
            " WHERE c.`del` <> 1".
            " AND c.`user_id` = ?".
            ($this->group_id ? " AND m.`contactgroup_id` = ?" : "").
            ($this->filter ? " AND (".$this->filter.")" : ""),
            $this->user_id,
            $this->group_id
        );

        $sql_arr = $this->db->fetch_assoc($sql_result);

        $this->cache['count'] = (int) $sql_arr['cnt'];

        return $this->cache['count'];
    }
926035
protected function GetRemainingRowCount()
    {
        $aTableList = $this->aTablesToProcess;
        $iCount = 0;
        foreach ($aTableList as $iWorkId) {
            $oIndexQuery = TdbShopSearchQuery::GetNewInstance();
            /** @var $oIndexQuery TdbShopSearchQuery */
            if ($oIndexQuery->Load($iWorkId)) {
                $iCount = $iCount + $oIndexQuery->NumberOfRecordsLeftToIndex();
            }
        }

        return $iCount;
    }
237612
protected function getEventsCount() {
    $query = $this->connection->select('node_field_data', 'n');
    $query->addExpression('COUNT(*)');
    $query->condition('n.type', 'event');
    $query->condition('n.status', 1);
    return $query->execute()->fetchField();
  }
1315656
public function count(): int
    {
        $amount = 0;
        // iterate with $key so the key consumer from peek() can have a look
        foreach ($this->elements as $key => $element) {
            $amount++;
        }

        return $amount;
    }
559340
public function hasAppointmentFields()
    {
        if (null === $this->_hasAppointmentFields) {
            $this->_hasAppointmentFields = false;

            foreach ($this->_trackFields as $field) {
                if (self::TYPE_APPOINTMENT == $field['gtf_field_type']) {
                    $this->_hasAppointmentFields = true;
                    break;
                }
            }
        }

        return $this->_hasAppointmentFields;
    }
961972
public static function getQueriesCount(){
		$qc=array(
			'mset'=>0,
			'set'=>0,
			'get'=>0,
			'mget'=>0,
			'gc'=>0);
		if (!is_object(self::$instance))
			return $qc;
		$cache=self::$instance;
		$qc['mset']=$cache->queries_mset_count;
		$qc['set']=$cache->queries_set_count;
		$qc['get']=$cache->queries_get_count;
		$qc['mget']=$cache->queries_mget_count;
		$qc['gc']=$cache->queries_gc_count;
		return $qc;
		}