Gets a (previously set) query parameter of the query being constructed.
public getParameter ( mixed $key ) : mixed | ||
$key | mixed | The key (index or name) of the bound parameter. |
리턴 | mixed | The value of the bound parameter. |
/** * @test */ public function getParameterDelegatesToConcreteQueryBuilder() { $this->concreteQueryBuilder->getParameter(Argument::exact('aField'))->shouldBeCalled()->willReturn('aValue'); $this->subject->getParameter('aField'); }
/** * Gets a (previously set) query parameter of the query being constructed. * * @param mixed $key The key (index or name) of the bound parameter. * * @return mixed The value of the bound parameter. */ public function getParameter($key) { return $this->queryBuilder->getParameter($key); }
public function testCreatePositionalParameter() { $qb = new QueryBuilder($this->conn); $qb->select('u.*')->from('users', 'u')->where($qb->expr()->eq('u.name', $qb->createPositionalParameter(10, \PDO::PARAM_INT))); $this->assertEquals('SELECT u.* FROM users u WHERE u.name = ?', (string) $qb); $this->assertEquals(10, $qb->getParameter(1)); }
/** * Gets a (previously set) query parameter of the query being constructed. * * @param mixed $key The key (index or name) of the bound parameter. * * @return mixed The value of the bound parameter. */ public function getParameter($key) { return $this->qb->getParameter($key); }