예제 #1
0
 /**
  * Get a query to count the number of rows that the resultset would contain.
  * 
  * @param int $flags  Query::ALL_ROWS
  * @return Query
  */
 public function count($flags = 0)
 {
     $statement = QuerySplitter::buildCountQuery($this->getParts(), $flags);
     return new self($statement);
 }
예제 #2
0
 public function testBuildCountQuery_DeleteJoin()
 {
     $sql = QuerySplitter::buildCountQuery("DELETE foo.* FROM foo INNER JOIN bar ON foo.id = bar.foo_id WHERE abc = 10");
     $this->assertEquals("SELECT COUNT(*) FROM foo INNER JOIN bar ON foo.id = bar.foo_id WHERE abc = 10", $sql);
 }