public function addRestService($serviceName, $entityOrCollection, array $privileges = null)
{
if (!in_array($entityOrCollection, $this->allowedRestTypes)) {
throw new Exception\InvalidArgumentException(sprintf('Invalid type "%s" provided for %s; must be one of "%s" or "%s"', $entityOrCollection, __METHOD__, self::TYPE_ENTITY, self::TYPE_COLLECTION));
}
$this->addRpcService($serviceName, sprintf('__%s__', $entityOrCollection), $privileges);
return $this;
}