Scalr\Api\DataType\ApiEntityAdapter::getSorting PHP Method

getSorting() public method

It processes HTTP Request and takes RULE_TYPE_SORTING of rules into account
public getSorting ( ) : array | null
return array | null Returns sorting option for the find method of the Entity
    public function getSorting()
    {
        $sorting = null;
        $rules = $this->getRules();
        if (!empty($rules[static::RULE_TYPE_SORTING][static::RULE_TYPE_PROP_DEFAULT])) {
            if (!is_array($rules[static::RULE_TYPE_SORTING][static::RULE_TYPE_PROP_DEFAULT])) {
                throw new \InvalidArgumentException(sprintf("[%s::RULE_TYPE_SORTING]['%s'] offset of the rules is expected to be an array", get_class($this), static::RULE_TYPE_PROP_DEFAULT));
            }
            $sorting = $rules[static::RULE_TYPE_SORTING][static::RULE_TYPE_PROP_DEFAULT];
        }
        return $sorting;
    }