public function isStatusChanged() { if ($this->oldAttributes['status_id'] != $this->status_id) { Yii::app()->eventManager->fire(OrderEvents::STATUS_CHANGED, new OrderChangeStatusEvent($this)); return true; } return false; }