/** * Отправка уведомления пользователю **/ public function send($user_id, $text) { $notification = new OffersUsersNotifications('create'); $notification->user_id = $user_id; $notification->text = $text; $notification->save(false); }
public function setStatus($status, $save = false, $notify = false) { $this->status = $status; //TODO: notification if needed if (!$this->isNewRecord && $notify) { $text = 'Ваша заявка на подключение предложения "' . $this->offer->name . '" переведена в статус "' . $this->getStatusName($status) . '"'; OffersUsersNotifications::model()->send($this->user_id, $text); } return $save ? $this->save(true) : true; }