/** * @param IResource|string $usersResource * @return bool */ private function isResourceQueried($usersResource) { $usersResourceId = Stringify::stringifyResource($usersResource); foreach ($this->resources as $resource) { $resourceId = Stringify::stringifyResource($resource); if ($usersResourceId === $resourceId) { return TRUE; } } return FALSE; }
/** * @param string[] $resources */ protected function validateResources(array $resources) { foreach ($resources as $resource) { $resource = Stringify::stringifyResource($resource); if (!array_key_exists($resource, $this->resources)) { throw new ResourceDoesNotExists("Resource '{$resource}' does not exists."); } } }