FunctionToAST() public method

public FunctionToAST ( Storm\Core\Object\IEntityMap $EntityMap, callable $Function, $ResolveVariables = true ) : Storm\Drivers\Fluent\Object\Functional\IAST
$EntityMap Storm\Core\Object\IEntityMap
$Function callable
return Storm\Drivers\Fluent\Object\Functional\IAST
 public function FunctionToAST(Object\IEntityMap $EntityMap, callable $Function, $ResolveVariables = true)
 {
     $Reflection = $this->Reader->GetReflection($Function);
     $ClosureHash = $this->FunctionHash($Reflection);
     $AST = null;
     if ($this->Cache->Contains($ClosureHash)) {
         $AST = $this->Cache->Retrieve($ClosureHash);
     }
     if (!$AST instanceof Closure\IAST) {
         $AST = parent::FunctionToAST($EntityMap, $Function, false);
         //$AST->ExpandVariables();
         $AST->Simplify();
         $this->Cache->Save('ClosureAST-' . $ClosureHash, $AST);
     }
     if ($ResolveVariables) {
         $AST->Resolve($Reflection->getStaticVariables());
         $AST->Simplify();
     }
     return $AST;
 }