protected static function parseFieldAndOrder($value, $defaultOrder)
    {
        if (preg_match('/^([^,]+)(,(asc|desc))?$/', $value, $match)) {
            return [$match[1], isset($match[3]) ? $match[3] : $defaultOrder];

        }

        throw new InvalidArgumentException(sprintf('Unable to parse field name or order from "%s"', $value));
    }
protected static function parseFieldAndOrder($value, $defaultOrder)
    {
        if (preg_match('/^([^,]+)(,(asc|desc))?$/', $value, $match)) {
            return [$match[1], isset($match[3]) ? $match[3] : $defaultOrder];

        }

        throw new InvalidArgumentException(sprintf('Unable to parse field name or order from "%s"', $value));
    }
protected static function parseFieldAndOrder ( $ value , $ defaultOrder ) { if ( preg_match ( '/^([^,]+)(,(asc|desc))?$/' , $ value , $ match ) ) { return [ $ match [ 1 ] , isset ( $ match [ 3 ] ) ? $ match [ 3 ] : $ defaultOrder ] ; } throw new InvalidArgumentException ( sprintf ( 'Unable to parse field name or order from "%s"' , $ value ) ) ; }
Parse query parameter and get field name and order.

@param string $value
@param string $defaultOrder default sort order if order is not given explicitly in query

@return string[]

@throws InvalidArgumentException when unable to parse field name or order
Parse query parameter and get field name and order .