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); }
public function interpretJoin($segmentId, IJoinOptionsInterpretation $joinOptionsInterpretation, IFunction $joinToFunction) { /* @var $joinOptionsInterpretation IJoinOptionsParser */ $this->segments[] = new Segments\Join($joinOptionsInterpretation->getJoinOptions(), $this->buildFunction($joinToFunction, Functions\ConnectorProjection::factory())); }
public function interpretJoinApply($operationId, IJoinOptionsInterpretation $joinOptionsInterpretation, IFunction $applyFunction) { /** @var $joinOptionsInterpretation IJoinOptionsParser */ $this->operation = new Operations\JoinApply($joinOptionsInterpretation->getJoinOptions(), $this->buildFunction($applyFunction, Functions\ConnectorMutator::factory())); }