add() публичный Метод

Adds an parameter to the collection with the supplied context.
public add ( Pinq\Providers\DSL\Compilation\Parameters\IQueryParameter $parameter ) : void
$parameter Pinq\Providers\DSL\Compilation\Parameters\IQueryParameter
Результат void
Пример #1
0
 public function testCustomParameter()
 {
     $parameterMock = $this->getMock('Pinq\\Providers\\DSL\\Compilation\\Parameters\\IQueryParameter');
     $parameterMock->expects($this->any())->method('evaluate')->with($this->equalTo(new ResolvedParameterRegistry(['abc' => 'foobar'])))->willReturn('resolved-value');
     $this->collection->add($parameterMock);
     $this->assertResolvesTo(['resolved-value'], ['abc' => 'foobar']);
 }
 protected function addParameter(Parameters\ParameterCollection $parameters, IFunction $function, O\Expression $expression, Parameters\IParameterHasher $hasher = null)
 {
     $parameters->add(new StructuralExpressionParameter($expression, $hasher ?: Parameters\ParameterHasher::valueType(), $function));
 }