/** * Convert object to array * * @param array $arrAttributes * @return array */ public function toArray(array $arrAttributes = array()) { $arr = parent::toArray($arrAttributes); $arr['rates'] = $this->getShippingRatesCollection()->toArray($arrAttributes); $arr['items'] = $this->getItemsCollection()->toArray($arrAttributes); foreach ($this->getTotals() as $k => $total) { $arr['totals'][$k] = $total->toArray(); } return $arr; }