You are here

public function RestWSEntityResourceController::count in RESTful Web Services 7.2

Implements RestWSQueryResourceControllerInterface::count().

Overrides RestWSQueryResourceControllerInterface::count

File

./restws.entity.inc, line 294
RESTful web services module integration for entities.

Class

RestWSEntityResourceController
Controller for entity-bases resources.

Code

public function count($filters = array()) {
  $query = new EntityFieldQuery();
  $query
    ->entityCondition('entity_type', $this->entityType);
  foreach ($filters as $filter => $value) {
    $this
      ->propertyQueryOperation($query, 'Condition', $filter, $value);
  }
  $query
    ->count();
  $this
    ->nodeAccess($query);
  return $query
    ->execute();
}