Author: Elliot Levin (elliotlevin@hotmail.com)
コード例 #1
0
 public function interpretJoinOptions(O\MethodCallExpression $expression, O\MethodCallExpression &$sourceExpression = null)
 {
     $defaultValueKeyPair = null;
     while (strcasecmp($this->getMethodName($expression), 'withDefault') === 0) {
         if ($defaultValueKeyPair === null) {
             $defaultValueKeyPair = [$this->getArgumentValueAt(0, $expression), $this->getOptionalArgumentValueAt(1, $expression)];
         }
         $expression = $this->getSourceMethodCall($expression);
     }
     switch (strtolower($this->getMethodName($expression))) {
         case 'on':
             $this->interpretation->interpretCustomJoinFilter($this->getFunctionAt($this->getId('filter'), 0, $expression));
             $expression = $this->getSourceMethodCall($expression);
             break;
         case 'onequality':
             $this->interpretation->interpretEqualityJoinFilter($this->getFunctionAt($this->getId('outer-key'), 0, $expression), $this->getFunctionAt($this->getId('inner-key'), 1, $expression));
             $expression = $this->getSourceMethodCall($expression);
             break;
     }
     $this->sourceInterpreter->interpretSource($this->getArgumentAt(0, $expression));
     $sourceInterpretation = $this->sourceInterpreter->getInterpretation();
     $isGroupJoin = strcasecmp($this->getMethodName($expression), 'groupJoin') === 0;
     $sourceExpression = $expression;
     return $this->interpretation->interpretJoinOptions($isGroupJoin, $sourceInterpretation, $defaultValueKeyPair !== null ? $this->getId('default-key') : null, $defaultValueKeyPair !== null ? $this->getId('default-value') : null, $defaultValueKeyPair);
 }
コード例 #2
0
ファイル: ScopeParser.php プロジェクト: timetoogo/pinq
 public function interpretJoin($segmentId, IJoinOptionsInterpretation $joinOptionsInterpretation, IFunction $joinToFunction)
 {
     /* @var $joinOptionsInterpretation IJoinOptionsParser */
     $this->segments[] = new Segments\Join($joinOptionsInterpretation->getJoinOptions(), $this->buildFunction($joinToFunction, Functions\ConnectorProjection::factory()));
 }
コード例 #3
0
ファイル: OperationParser.php プロジェクト: timetoogo/pinq
 public function interpretJoinApply($operationId, IJoinOptionsInterpretation $joinOptionsInterpretation, IFunction $applyFunction)
 {
     /** @var $joinOptionsInterpretation IJoinOptionsParser */
     $this->operation = new Operations\JoinApply($joinOptionsInterpretation->getJoinOptions(), $this->buildFunction($applyFunction, Functions\ConnectorMutator::factory()));
 }