M1\Vars\Resource\ResourceProvider::mergeParentContent PHP Method

mergeParentContent() public method

Merges the content and the parent content together
public mergeParentContent ( ) : ResourceProvider
return ResourceProvider
    public function mergeParentContent()
    {
        $this->content = $this->mergeContents($this->content, $this->parent_content);
        return $this;
    }

Usage Example

Beispiel #1
0
 /**
  * Creates a new instance of Vars
  *
  * @param string|array $resource The main configuration resource
  * @param array        $options  The options being used for Vars
  */
 public function __construct($resource, $options = array())
 {
     $options = $this->parseOptions($options);
     $this->makeCache($options, $resource);
     $this->makePaths($options);
     if (!$this->cache->checkCache()) {
         $this->makeLoader($options);
         $this->makeVariables($options);
         $resource = new ResourceProvider($this, $resource);
     }
     if ($this->cache->isHit()) {
         $this->loadFromCache();
     } else {
         $resource->mergeParentContent();
         $this->content = $resource->getContent();
         $this->cache->setTime(time());
         $this->cache->makeCache($this);
     }
 }