/** * @return CmsSite */ public function getSite() { //return $this->hasOne(CmsSite::className(), ['code' => 'site_code']); return CmsSite::getByCode($this->site_code); }