M1\Vars\Resource\FileResource::parseContent PHP Method

parseContent() private method

Parses the contents inside the content array
private parseContent ( mixed $key, mixed $value, array $returned_content, string $prefix ) : array
$key mixed The key of the content array
$value mixed The value of the key
$returned_content array The modified content array to return
$prefix string The array prefix for the entity
return array Returns the modified content array
    private function parseContent($key, $value, $returned_content, $prefix)
    {
        if ($key === 'imports' && !is_null($value) && !empty($value)) {
            $imported_resource = $this->useImports($value);
            if ($imported_resource) {
                $returned_content = array_replace_recursive($returned_content, $imported_resource);
            }
        } elseif (is_array($value)) {
            $returned_content[$key] = $this->searchForResources($value, $this->variables->vstore->createPrefixName($prefix, $key));
        } else {
            $value = $this->parseText($value);
            $this->variables->vstore->set($prefix . $key, $value);
            $returned_content[$key] = $value;
        }
        return $returned_content;
    }