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

        //Check if is set AND validate
        if (isset($parameters['resource_id'])
            && preg_match(Validate::REGEXP_RESOURCE_ID, $parameters['resource_id']) !== false
        ) {
            if ($UINTEGER) {
                return UnsignedIntegerValidator::parseStatic($parameters['resource_id']);
            }
            return $parameters['resource_id'];
        }

        if (isset($parameters['id'])
            && preg_match(Validate::REGEXP_RESOURCE_ID, $parameters['id']) !== false
        ) {
            if ($UINTEGER) {
                return UnsignedIntegerValidator::parseStatic($parameters['id']);
            }
            return $parameters['id'];
        }
        return false;
    }
public static function resourceId($parameters, $UINTEGER = true)
    {
        //Work with arrays
        if (is_object($parameters)) {
            $parameters = (array)$parameters;
        }

        //Check if is set AND validate
        if (isset($parameters['resource_id'])
            && preg_match(Validate::REGEXP_RESOURCE_ID, $parameters['resource_id']) !== false
        ) {
            if ($UINTEGER) {
                return UnsignedIntegerValidator::parseStatic($parameters['resource_id']);
            }
            return $parameters['resource_id'];
        }

        if (isset($parameters['id'])
            && preg_match(Validate::REGEXP_RESOURCE_ID, $parameters['id']) !== false
        ) {
            if ($UINTEGER) {
                return UnsignedIntegerValidator::parseStatic($parameters['id']);
            }
            return $parameters['id'];
        }
        return false;
    }
public static function resourceId ( $ parameters , $ UINTEGER = true ) { //Work with arrays if ( is_object ( $ parameters ) ) { $ parameters = ( array ) $ parameters ; } //Check if is set AND validate if ( isset ( $ parameters [ 'resource_id' ] ) && preg_match ( Validate :: REGEXP_RESOURCE_ID , $ parameters [ 'resource_id' ] ) !== false ) { if ( $ UINTEGER ) { return UnsignedIntegerValidator :: parseStatic ( $ parameters [ 'resource_id' ] ) ; } return $ parameters [ 'resource_id' ] ; } if ( isset ( $ parameters [ 'id' ] ) && preg_match ( Validate :: REGEXP_RESOURCE_ID , $ parameters [ 'id' ] ) !== false ) { if ( $ UINTEGER ) { return UnsignedIntegerValidator :: parseStatic ( $ parameters [ 'id' ] ) ; } return $ parameters [ 'id' ] ; } return false ; }
Require id parameter if it's set else return NULL, it uses `resource_id` or `id` parameter if available
@param  array|object $parameters  The request parameters
@param  boolean      $UINTEGER  *[Optional]*, Check id's type to be unsigned integer
@throws \Phramework\Exceptions\IncorrectParameters When value is not correct
@return string|integer Returns the id or NULL if not set,
if $UINTEGER the returned value will be converted to unsigned integer
Require id parameter if it s set else return NULL it uses resource_id or id parameter if available