Skip to content
This repository was archived by the owner on Mar 14, 2021. It is now read-only.
This repository was archived by the owner on Mar 14, 2021. It is now read-only.

The sort function #46

@alacret

Description

@alacret
/**
 * Setting the sort to a specified value.
 * Allows to sort results, only if the cattegory selected is not 'ALL'
 *
 * @param string $parameter
 *
 * @return AmazonECS
 * 
 * @autor alacret
 * 
 */
public function sort($parameter) {
    if(!isset($this -> requestConfig['category']) or $this -> requestConfig['category'] == null ){
        throw new InvalidArgumentException('A category must be set before adding the sort parameter');
    }
    if($this -> requestConfig['category'] == "All" ){
        throw new InvalidArgumentException('The sort is not supported for the "All" category');
    }
    if($parameter == null or $parameter == "" ){
        throw new InvalidArgumentException(sprintf('%s : invalid value for sort parameter',$parameter));
    }

    $this -> responseConfig['optionalParameters'] = array_merge($this -> responseConfig['optionalParameters'], array("Sort" => $parameter));

    return $this;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions