/** * Detect and handle requests for ?distinctCount * * @return null|array * * <p>If null, then distinctCount does not apply. Otherwise, the return array should * be used as a return payload for the request</p> */ protected function handleDistinctCount($field, $conditions = array(), $misc = array()) { if (!$this->model->getSchema($field)) { $this->badRequest('Field requested for distinctCount does not appear in the relevant model schema'); } $conditions = $this->unwrapConditions($conditions); return $this->model->distinctCount($field, $conditions, $misc); }