Beispiel #1
0
 /**
  * List of all questions ASKED TO THIS USER by others.
  *
  * @param bool|false $withGlobal
  * @return mixed
  */
 public function askedQuestions($withGlobal = false)
 {
     if ($withGlobal == false) {
         return \App\Question::whereForUserId($this->id);
     } else {
         return \App\Question::whereForUserId($this->id)->orWhere('for_user_id', null);
     }
 }