Spot\Log::queryCount PHP Method

queryCount() public static method

Get a count of how many queries have been run
public static queryCount ( ) : integer
return integer Total number of queries that have been run
    public static function queryCount()
    {
        return self::$_queryCount;
    }

Usage Example

Example #1
0
 public function testQueryCountIsNotCachedForDifferentQueryResult()
 {
     $mapper = test_spot_mapper();
     $posts = $mapper->all('\\Spot\\Entity\\Post');
     $this->assertEquals(10, $posts->count());
     // Count # of queries
     $count1 = \Spot\Log::queryCount();
     // Change query so count will NOT be cached
     $this->assertEquals(3, $posts->where(array('status' => array(3, 4, 5)))->count());
     // Count again to ensure it is NOT cached since there are query changes
     $count2 = \Spot\Log::queryCount();
     $this->assertNotEquals($count1, $count2);
 }
All Usage Examples Of Spot\Log::queryCount