eZ\Publish\Core\Persistence\TransformationProcessor\DefinitionBased\Parser::parse PHP Method

parse() public method

Parse the specified transformation file into an AST.
public parse ( string $file ) : array
$file string
return array
    public function parse($file)
    {
        return $this->parseString(file_get_contents($file));
    }

Usage Example

 /**
  * Loads rules.
  *
  * @return array
  */
 protected function getRules()
 {
     if ($this->compiledRules === null) {
         $rules = array();
         foreach ($this->ruleFiles as $file) {
             $rules = array_merge($rules, $this->parser->parse($file));
         }
         $this->compiledRules = $this->compiler->compile($rules);
     }
     return $this->compiledRules;
 }
All Usage Examples Of eZ\Publish\Core\Persistence\TransformationProcessor\DefinitionBased\Parser::parse