/** * Set the order status history object and the order object to each other * Adds the object to the status history collection, which is automatically saved when the order is saved. * See the entity_id attribute backend model. * Or the history record can be saved standalone after this. * * @param Mage_Sales_Model_Order_Status_History $status * @return Mage_Sales_Model_Order */ public function addStatusHistory(Mage_Sales_Model_Order_Status_History $history) { $history->setOrder($this); $this->setStatus($history->getStatus()); if (!$history->getId()) { $this->getStatusHistoryCollection()->addItem($history); } return $this; }
public function addStatusHistory(Mage_Sales_Model_Order_Status_History $status) { $status->setOrder($this)->setParentId($this->getId())->setStoreId($this->getStoreId()); $this->setStatus($status->getStatus()); if (!$status->getId()) { $this->getStatusHistoryCollection()->addItem($status); } return $this; }