Exemplo n.º 1
0
 /**
  * @return Address - associated with parent having type set to residential
  */
 public function getFiles()
 {
     return $this->hasmany(CmgFile::className(), ['id' => 'fileId'])->viaTable(CoreTables::TABLE_MODEL_FILE, ['parentId' => 'id'], function ($query) {
         $modelFile = CoreTables::TABLE_MODEL_FILE;
         $query->onCondition("{$modelFile}.parentType=:type", [':type' => $this->fileType]);
     });
 }
Exemplo n.º 2
0
 /**
  * @return CmgFile - associated file
  */
 public function getFile()
 {
     return $this->hasOne(CmgFile::className(), ['id' => 'fileId']);
 }
Exemplo n.º 3
0
 public function getVideo()
 {
     return $this->hasOne(CmgFile::className(), ['id' => 'videoId']);
 }
Exemplo n.º 4
0
 /**
  * @return File - file url
  */
 public function getBanner()
 {
     return $this->hasOne(CmgFile::className(), ['id' => 'bannerId']);
 }
Exemplo n.º 5
0
 /**
  * @return File - file url
  */
 public function getAvatar()
 {
     return $this->hasOne(CmgFile::className(), ['id' => 'avatarId']);
 }