protected static function restGetPerPage($default = 10)
    {
        $perPage = Request::getInstance()->query('_perPage', $default);
        if (!is_numeric($perPage) || $perPage < 1 || $perPage > 1000) {
            return $default;
        }

        return (int)$perPage;
    }