Exemple #1
0
 public function testParameterMethods()
 {
     $this->builder->select('*');
     $this->assertEquals('?', $this->builder->createPositionalParameter(0));
     $this->assertEquals(['?', '?'], $this->builder->createPositionalParameter([0, 1]));
     $this->builder->select('*');
     $this->assertEquals(':parameter0', $this->builder->createNamedParameter(0));
     $this->assertEquals([':parameter1', ':parameter2'], $this->builder->createNamedParameter([0, 1]));
 }
Exemple #2
0
 /**
  * Count selected records
  *
  * @param array $parameters
  *
  * @return mixed
  */
 public function count(array $parameters = [])
 {
     $this->manager->commit();
     $count = $this->applyFilters($this->queryBuilder->select('count(*) as count')->from($this->entity->getTable(), $this->alias))->query(array_merge($this->parameters, $parameters))->fetch();
     return $count['count'];
 }