/** * Migrates the services from the old basket to the current one. * * @param MShop_Order_Item_Base_Interface $basket Basket object * @param array $errors Associative list of previous errors * @return array Associative list of errors occured */ private function _copyServices(MShop_Order_Item_Base_Interface $basket, array $errors) { foreach ($basket->getServices() as $type => $item) { try { $attributes = array(); foreach ($item->getAttributes() as $attrItem) { $attributes[$attrItem->getCode()] = $attrItem->getValue(); } $this->setService($type, $item->getServiceId(), $attributes); $basket->deleteService($type); } catch (Exception $e) { } // Don't notify the user as appropriate services can be added automatically } return $errors; }