/** * @see RM_Presents_Order_State::canChangeStateTo() */ public function canChangeStateTo($name) { if (parent::canChangeStateTo($name)) { $i = 0; foreach ($this->_obOrder->getItemsList() as $obItem) { if (!isNull($obEquipment = $obItem->getEquipment()) && $obEquipment->isDelivered()) { $i++; } } if ($i != count($this->_obOrder->getItemsList())) { return FALSE; } } return parent::canChangeStateTo($name); }
/** * Enter description here... * * @return void */ public function __construct(RM_Presents_Order_Object $obOrder, $data = NULL) { $this->_name = RM_Presents_Order_State::CLOSED; parent::__construct($obOrder, $data); }