diff --git a/ActiveRecord.php b/ActiveRecord.php
index <HASH>..<HASH> 100644
--- a/ActiveRecord.php
+++ b/ActiveRecord.php
@@ -4,6 +4,28 @@ namespace kato;
 
 class ActiveRecord extends \yii\db\ActiveRecord
 {
+
+    /**
+     * Attached Content Media, by type
+     * @return static
+     */
+    public function getContentMedia()
+    {
+        return $this->hasMany(\backend\models\ContentMedia::className(), ['content_id' => 'id'])
+            ->where('media_type = :type', [':type' => $this->className()]);
+    }
+
+    /**
+     * Relate Media
+     * Usage: $model->media();
+     * @return static
+     */
+    public function getMedia()
+    {
+        return $this->hasMany(\backend\models\Media::className(), ['id' => 'media_id'])
+            ->via('contentMedia');
+    }
+
     /**
      * Actions to be taken before saving the record.
      * @param bool $insert
Added model relation to activerecords