src/Charcoal/Source/AbstractSource.php
public function addOrder($param, $mode = 'asc', array $options = null)
    {
        if (is_string($param) && $mode !== null) {
            $expr = $this->createOrder();
            $expr->setProperty($param);
            $expr->setMode($mode);
        } else {
            $expr = $param;
        }

        $expr = $this->processOrder($expr);

        /** @deprecated 0.3 */
        if (is_array($param) && isset($param['options'])) {
            $expr->setData($param['options']);
        }

        if (is_array($options)) {
            $expr->setData($options);
        }

        $this->orders[] = $this->parseOrderWithModel($expr);
        return $this;
    }
public function addOrder($param, $mode = 'asc', array $options = null)
    {
        if (is_string($param) && $mode !== null) {
            $expr = $this->createOrder();
            $expr->setProperty($param);
            $expr->setMode($mode);
        } else {
            $expr = $param;
        }

        $expr = $this->processOrder($expr);

        /** @deprecated 0.3 */
        if (is_array($param) && isset($param['options'])) {
            $expr->setData($param['options']);
        }

        if (is_array($options)) {
            $expr->setData($options);
        }

        $this->orders[] = $this->parseOrderWithModel($expr);
        return $this;
    }
public function addOrder ( $ param , $ mode = 'asc' , array $ options = null ) { if ( is_string ( $ param ) && $ mode !== null ) { $ expr = $ this -> createOrder ( ) ; $ expr -> setProperty ( $ param ) ; $ expr -> setMode ( $ mode ) ; } else { $ expr = $ param ; } $ expr = $ this -> processOrder ( $ expr ) ; /** @deprecated 0.3 */ if ( is_array ( $ param ) && isset ( $ param [ 'options' ] ) ) { $ expr -> setData ( $ param [ 'options' ] ) ; } if ( is_array ( $ options ) ) { $ expr -> setData ( $ options ) ; } $ this -> orders [ ] = $ this -> parseOrderWithModel ( $ expr ) ; return $ this ; }
Append a query order on the source.

@deprecated 0.3 To be replaced with OrderCollectionTrait::addOrder()

@uses   self::parseOrderWithModel()
@uses   OrderCollectionTrait::processOrder()
@param  mixed  $param   The property to sort by,
a {@see OrderInterface} object,
or a order array structure.
@param  string $mode    Optional sorting mode.
Defaults to ascending if a property is provided.
@param  array  $options Optional extra settings to apply on the order.
@throws InvalidArgumentException If the $param argument is invalid.
@return self
Append a query order on the source .