/**
  * Returns the Message Model by given Id
  * Also an access check will be performed.
  *
  * If insufficed privileges or not found null will be returned.
  *
  * @param int $id
  */
 private function getMessage($id)
 {
     $message = ServicesMessage::findOne(['id' => $id]);
     if ($message != null) {
         $userMessage = ServicesUserMessage::findOne(['user_id' => Yii::$app->user->id, 'message_id' => $message->id]);
         if ($userMessage != null) {
             return $message;
         }
     }
     return null;
 }
 public function getServicesmessage()
 {
     return $this->hasOne(ServicesMessage::className(), ['id' => 'message_id']);
 }