DB\Jig\Mapper::count PHP Method

count() public method

Count records that match criteria
public count ( $filter = NULL, $ttl ) : integer
$filter array
$ttl int
return integer
    function count($filter = NULL, $ttl = 0)
    {
        $now = microtime(TRUE);
        $out = count($this->find($filter, NULL, $ttl, FALSE));
        $this->db->jot('(' . sprintf('%.1f', 1000.0 * (microtime(TRUE) - $now)) . 'ms) ' . $this->file . ' [count] ' . ($filter ? json_encode($filter) : ''));
        return $out;
    }