コード例 #1
0
 /**
  * Attached Content Media, by type
  * @return static
  */
 public function getContentMedia()
 {
     return $this->hasMany(ContentMedia::className(), ['content_id' => 'id'])->where('content_type = :type', [':type' => $this->className()]);
 }
コード例 #2
0
ファイル: Media.php プロジェクト: perminder-klair/kato-core
 /**
  * Attached Content Media, by type
  * @return static
  */
 public function getMediaContent()
 {
     return $this->hasOne(ContentMedia::className(), ['id' => 'content_id']);
     //->where('content_type = :type', [':type' => $this->className()]);
 }