/** * 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()]); }
/** * 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()]); }