add() public method

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
return 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']);
 }
コード例 #2
0
 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));
 }