public function create($address)
    {
        if (is_array($address)) {
            $address = new OrderAddress($address);
        }

        if ($address instanceof OrderAddress) {
            if ($this->fireEvent('creating', array($address)) === false) {
                return false;
            }

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

            $this->fireEvent('created', array($address));

            $address = $this->find($address->id);

            return $address;
        }

        throw new Exception(sprintf(Exception::CANT_CREATE_MODEL,
            'Subbly\\Model\\Order',
            $this->name()
        ));
    }
public function create($address)
    {
        if (is_array($address)) {
            $address = new OrderAddress($address);
        }

        if ($address instanceof OrderAddress) {
            if ($this->fireEvent('creating', array($address)) === false) {
                return false;
            }

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

            $this->fireEvent('created', array($address));

            $address = $this->find($address->id);

            return $address;
        }

        throw new Exception(sprintf(Exception::CANT_CREATE_MODEL,
            'Subbly\\Model\\Order',
            $this->name()
        ));
    }
public function create ( $ address ) { if ( is_array ( $ address ) ) { $ address = new OrderAddress ( $ address ) ; } if ( $ address instanceof OrderAddress ) { if ( $ this -> fireEvent ( 'creating' , array ( $ address ) ) === false ) { return false ; } $ address -> setCaller ( $ this ) ; $ address -> save ( ) ; $ this -> fireEvent ( 'created' , array ( $ address ) ) ; $ address = $ this -> find ( $ address -> id ) ; return $ address ; } throw new Exception ( sprintf ( Exception :: CANT_CREATE_MODEL , 'Subbly\\Model\\Order' , $ this -> name ( ) ) ) ; }
Create a new OrderAdress.

@example
$order = Subbly\Model\OrderAddress;
Subbly::api('subbly.orderadress')->create($order, $address);

@param \Subbly\Model\OrderAdress|array $orderAddress

@return \Subbly\Model\OrderAddress

@api
Create a new OrderAdress .