You are here

public function CiviCrmApi::getCount in CiviCRM Entity 8.3

Get the count of entries for an entity.

Parameters

string $entity: The entity name.

array $params: The array of field values.

Return value

int The number of entities.

Overrides CiviCrmApiInterface::getCount

File

src/CiviCrmApi.php, line 88

Class

CiviCrmApi
CiviCRM API implementation.

Namespace

Drupal\civicrm_entity

Code

public function getCount($entity, array $params = []) {
  $this
    ->initialize();
  $result = civicrm_api3($entity, 'getcount', $params);
  return is_int($result) ? $result : $result['result'];
}