저자: Elliot Levin (elliotlevin@hotmail.com)
상속: extends ParameterCollectionBase
 public function visitOrderBy(Segments\OrderBy $segment)
 {
     $staticOrderings = [];
     foreach ($segment->getOrderings() as $key => $ordering) {
         $staticOrderings[$key] = new StaticOrdering($ordering->getProjectionFunction(), $this->parameters->getResolvedParameters()[$ordering->getIsAscendingId()]);
     }
     return parent::visitOrderBy($segment->update($staticOrderings));
 }
 protected function getResolvedValue(ResolvedParameterRegistry $resolvedParameters, O\Expression $expression)
 {
     foreach ($resolvedParameters->getParameters() as $parameter) {
         if ($parameter instanceof StructuralExpressionParameter && $parameter->getExpression() === $expression) {
             return $resolvedParameters->getValue($parameter);
         }
     }
     throw new PinqException('Could not get structural expression: matching expression was not found.');
 }
예제 #3
0
 protected function queryTemplateMock($queryTemplateClass)
 {
     $queryTemplateMock = $this->getMockForAbstractClass($queryTemplateClass);
     $queryTemplateMock->expects($this->once())->method('resolveStructuralParameters')->will($this->returnValue(Compilation\Parameters\ResolvedParameterRegistry::none()));
     $queryTemplateMock->expects($this->once())->method('getParameters')->will($this->returnValue(new Queries\ParameterRegistry([])));
     return $queryTemplateMock;
 }
 public function visitRange(Segments\Range $segment)
 {
     return parent::visitRange(new StaticRange($this->parameters->getResolvedParameters()[$segment->getStartId()], $this->parameters->getResolvedParameters()[$segment->getAmountId()]));
 }