/** * @return \yii\db\ActiveQuery */ public function getMessages() { return $this->hasMany(Message::className(), ['facility_id' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getMessages() { return $this->hasMany(Message::className(), ['parent_message_id' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getMessagesTo() { return $this->hasMany(Message::className(), ['to' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getI18nMessages() { return $this->hasMany(Message::className(), ['id' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getMessage() { return $this->hasOne(Message::className(), ['id' => 'message_id']); }
public function getContent($language = null) { $language = $language === null ? Lang::getCurrent()->code : $language; return $this->hasOne(Message::className(), ['id' => 'id'])->where('language = :language', [':language' => $language]); }