MODE_ASC
MODE_ASC
Order
Available modes:
asc
to order in ascending (A-Z / 0-9) order.desc
to order in descending (Z-A / 9-0) order.rand
to order in a random fashion.values
to order by a defined array of properties.custom
to order by a custom SQL string.setData(array $data) : \Charcoal\Source\Order
array | $data | The order data. |
Chainable
setProperty(string $property) : \Charcoal\Source\Order
string | $property | The order property. |
If the property argument is not a string.
(Chainable)
setMode(string $mode) : \Charcoal\Source\Order
string | $mode | The order mode. |
If the mode is not a string or invalid.
Chainable
setValues(string|array $values) : \Charcoal\Source\Order
Set the values.
Values are ignored if the mode is not "values"
If the $values
argument is a string, it will be split by ",".
If it is an array, the values will be used as is.
Otherwise, the function will throw an error
string|array | $values | The order values. |
If the parameter is not an array or a string.
(Chainable)
setString(string $sql) : \Charcoal\Source\Order
string | $sql | The custom order SQL string. |
If the parameter is not a valid operand.
(Chainable)
setActive(boolean $active) : \Charcoal\Source\Order
boolean | $active | The active flag. |
(Chainable)