public static function requireId($parameters, $UINTEGER = true)
    {
        //Work with arrays
        if (is_object($parameters)) {
            $parameters = (array)$parameters;
        }

        if (isset($parameters['resource_id'])
            && preg_match(Validate::REGEXP_RESOURCE_ID, $parameters['resource_id']) !== false
        ) {
            $parameters['id'] = $parameters['resource_id'];
        }
        if (!isset($parameters['id'])) {
            throw new MissingParametersException(['id']);
        }

        //Validate as unsigned integer
        if ($UINTEGER
            && filter_var($parameters['id'], FILTER_VALIDATE_INT, ['options' => ['min_range' => 0]]) === false
        ) {
            throw new IncorrectParametersException(['id']);
        } elseif (!$UINTEGER
            && preg_match(Validate::REGEXP_RESOURCE_ID, $parameters['id']) === false
        ) {
            //Validate as alphanumeric
            throw new IncorrectParametersException(['id']);
        }
        return ($UINTEGER ? intval($parameters['id']) : $parameters['id']);
    }