public static function count($where = array())
    {
        // fetch the count with $where parameters
        $rawSqlFetch = self::select(array("count(*) as nb"), $where);

        return isset($rawSqlFetch[0]) && isset($rawSqlFetch[0]['nb']) ? (int)$rawSqlFetch[0]['nb'] : null;
    }