Author: Elliot Levin (elliotlevin@hotmail.com)
Exemplo n.º 1
0
 /**
  * @return mixed
  */
 public function compile()
 {
     foreach ($this->scope->getSegments() as $segment) {
         $segment->traverse($this);
     }
 }
Exemplo n.º 2
0
 public static function evaluate(Queries\IScope $scope, Queries\IResolvedParameterRegistry $resolvedParameters)
 {
     $sourceInfo = $scope->getSourceInfo();
     if (!$sourceInfo instanceof SourceInfo) {
         throw new PinqException('Incompatible query source: expecting source info of type %s, %s given', SourceInfo::SOURCE_INFO_TYPE, get_class($sourceInfo));
     }
     $evaluator = new self($sourceInfo->getTraversable(), $resolvedParameters);
     $evaluator->visit($scope);
     return $evaluator->traversable;
 }
Exemplo n.º 3
0
 public function buildScope()
 {
     return new Queries\Scope($this->processSourceInfo($this->scope->getSourceInfo()), $this->processSegments($this->scope->getSegments()));
 }
Exemplo n.º 4
0
 /**
  * @param IScope $scope
  *
  * @return IScope
  */
 public final function visit(IScope $scope)
 {
     $scope->visit($this);
 }
Exemplo n.º 5
0
 public function visit(ISegmentVisitor $visitor)
 {
     $this->scope->visit($visitor);
 }