public function update()
    {
        $args    = func_get_args();
        $order = null;

        if (count($args) == 1 && $args[0] instanceof Order) {
            $order = $args[0];
        } elseif (count($args) == 2 && !empty($args[0]) && is_array($args[1])) {
            $order = $this->find($args[0]);
            $order->fill($args[1]);
        }

        if ($order instanceof Order) {
            if ($this->fireEvent('updating', array($order)) === false) {
                return false;
            }

            $order->setCaller($this);
            $order->save();

            $this->fireEvent('updated', array($order));

            return $order;
        }

        throw new Exception(sprintf(Exception::CANT_UPDATE_MODEL,
            'Subbly\\Model\\Order',
            $this->name()
        ));
    }
public function update()
    {
        $args    = func_get_args();
        $order = null;

        if (count($args) == 1 && $args[0] instanceof Order) {
            $order = $args[0];
        } elseif (count($args) == 2 && !empty($args[0]) && is_array($args[1])) {
            $order = $this->find($args[0]);
            $order->fill($args[1]);
        }

        if ($order instanceof Order) {
            if ($this->fireEvent('updating', array($order)) === false) {
                return false;
            }

            $order->setCaller($this);
            $order->save();

            $this->fireEvent('updated', array($order));

            return $order;
        }

        throw new Exception(sprintf(Exception::CANT_UPDATE_MODEL,
            'Subbly\\Model\\Order',
            $this->name()
        ));
    }
public function update ( ) { $ args = func_get_args ( ) ; $ order = null ; if ( count ( $ args ) == 1 && $ args [ 0 ] instanceof Order ) { $ order = $ args [ 0 ] ; } elseif ( count ( $ args ) == 2 && ! empty ( $ args [ 0 ] ) && is_array ( $ args [ 1 ] ) ) { $ order = $ this -> find ( $ args [ 0 ] ) ; $ order -> fill ( $ args [ 1 ] ) ; } if ( $ order instanceof Order ) { if ( $ this -> fireEvent ( 'updating' , array ( $ order ) ) === false ) { return false ; } $ order -> setCaller ( $ this ) ; $ order -> save ( ) ; $ this -> fireEvent ( 'updated' , array ( $ order ) ) ; return $ order ; } throw new Exception ( sprintf ( Exception :: CANT_UPDATE_MODEL , 'Subbly\\Model\\Order' , $ this -> name ( ) ) ) ; }
Update a Order.

@example
$order = [Subbly\Model\Order instance];
Subbly::api('subbly.order')->update($order);

Subbly::api('subbly.order')->update($id, array(
'firstname' => 'Jon',
'lastname'  => 'Snow',
));

@return \Subbly\Model\Order

@api
Update a Order .