resourceImported() public method

Tests to see if the resource has been imported already -- this is to avoid getting into a infinite loop
public resourceImported ( FileResource | string $resource ) : boolean
$resource M1\Vars\Resource\FileResource | string Resource to check
return boolean Has resource already been imported
Example #1
0
 /**
  * Creates the FileResource|ResourceProvider from the resource
  *
  * @param array  $resources The array of resources
  * @param string $type      The type of the resource
  */
 private function createResources(array $resources, $type)
 {
     foreach ($resources as $resource) {
         if ($type === "string") {
             $this->vars->pathsLoadedCheck($resource);
             if ($this->vars->cache->checkCache()) {
                 return;
             }
             if ($this->vars->resourceImported($resource)) {
                 continue;
             }
             $pos = $this->vars->addResource($resource);
             $resource = new FileResource($this, $resource);
             $this->vars->updateResource($resource, $pos);
         } else {
             $resource = new ResourceProvider($this->vars, $resource);
         }
         $this->addContent($resource->getContent());
     }
 }