Пример #1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSuppliers()
 {
     return $this->hasMany(Supplier::className(), ['id' => 'supplier_id'])->viaTable('{{%product_supplier}}', ['product_id' => 'id']);
 }
Пример #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSupplier()
 {
     return $this->hasOne(Supplier::className(), ['id' => 'supplier_id']);
 }