public function processSource(Queries\Common\ISource $source) { if ($source instanceof Queries\Common\Source\QueryScope) { $processor = $this->forSubScope($source->getScope()); return $source->update($processor->buildScope()); } return $source; }
public function appendSource(Queries\Common\ISource $source, $d = false) { if ($source instanceof Queries\Common\Source\ArrayOrIterator) { $this->append('[array or iterator]'); } elseif ($source instanceof Queries\Common\Source\SingleValue) { $this->append('[single value]'); } elseif ($source instanceof Queries\Common\Source\QueryScope) { $compilation = new self(); $compiler = new ScopeCompiler($compilation, $source->getScope()); $compiler->compile(); $this->appendLine('['); foreach (array_filter(explode(PHP_EOL, $compilation->asCompiled())) as $line) { $this->appendLine(' ' . $line); } $this->append(']'); } }
public static function evaluateSource(Common\ISource $source, Queries\IResolvedParameterRegistry $resolvedParameters) { if ($source instanceof Common\Source\ArrayOrIterator) { return $resolvedParameters[$source->getId()]; } elseif ($source instanceof Common\Source\SingleValue) { return [$resolvedParameters[$source->getId()]]; } elseif ($source instanceof Common\Source\QueryScope) { return self::evaluate($source->getScope(), $resolvedParameters); } }
public function getParameters() { return $this->source->getParameters(); }
public function getParameters() { return array_merge($this->source->getParameters(), $this->filter === null ? [] : $this->filter->getParameters(), $this->hasDefault ? [$this->defaultValueId, $this->defaultKeyId] : []); }