コード例 #1
0
ファイル: ImageStore.php プロジェクト: dkhru/yii2-image-store
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getStore()
 {
     return $this->hasOne(Store::className(), ['id' => 'store_id']);
 }
コード例 #2
0
ファイル: Image.php プロジェクト: dkhru/yii2-image-store
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getStores()
 {
     return $this->hasMany(Store::className(), ['id' => 'store_id'])->viaTable('{{%dkh_image_store}}', ['image_id' => 'id']);
 }