示例#1
0
 /**
  * @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;
 }
示例#2
0
 /**
  * @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.");
         }
     }
 }