src/Charcoal/Source/Order.php
public function setValues($values)
    {
        if ($values === null) {
            $this->values = $values;
            return $this;
        }

        if (is_string($values)) {
            if ($values === '') {
                throw new InvalidArgumentException(
                    'String values can not be empty.'
                );
            }

            $values = array_map('trim', explode(',', $values));
        }

        if (is_array($values)) {
            if (empty($values)) {
                throw new InvalidArgumentException(
                    'Array values can not be empty.'
                );
            }

            $this->values = $values;
            return $this;
        }

        throw new InvalidArgumentException(sprintf(
            'Order Values must be an array or comma-delimited string, received %s',
            is_object($values) ? get_class($values) : gettype($values)
        ));
    }
public function setValues($values)
    {
        if ($values === null) {
            $this->values = $values;
            return $this;
        }

        if (is_string($values)) {
            if ($values === '') {
                throw new InvalidArgumentException(
                    'String values can not be empty.'
                );
            }

            $values = array_map('trim', explode(',', $values));
        }

        if (is_array($values)) {
            if (empty($values)) {
                throw new InvalidArgumentException(
                    'Array values can not be empty.'
                );
            }

            $this->values = $values;
            return $this;
        }

        throw new InvalidArgumentException(sprintf(
            'Order Values must be an array or comma-delimited string, received %s',
            is_object($values) ? get_class($values) : gettype($values)
        ));
    }
public function setValues ( $ values ) { if ( $ values === null ) { $ this -> values = $ values ; return $ this ; } if ( is_string ( $ values ) ) { if ( $ values === '' ) { throw new InvalidArgumentException ( 'String values can not be empty.' ) ; } $ values = array_map ( 'trim' , explode ( ',' , $ values ) ) ; } if ( is_array ( $ values ) ) { if ( empty ( $ values ) ) { throw new InvalidArgumentException ( 'Array values can not be empty.' ) ; } $ this -> values = $ values ; return $ this ; } throw new InvalidArgumentException ( sprintf ( 'Order Values must be an array or comma-delimited string, received %s' , is_object ( $ values ) ? get_class ( $ values ) : gettype ( $ values ) ) ) ; }
Set the values to sort against.

Note: Values are ignored if the mode is not {@see self::MODE_VALUES}.

@throws InvalidArgumentException If the parameter is not an array or a string.
@param  string|array|null $values A list of field values.
If the $values parameter:
- is a string, the string will be split by ",".
- is an array, the values will be used as is.
- any other data type throws an exception.
@return self
Set the values to sort against .