Ejemplo n.º 1
0
 /**
  * Defines the relationship with the ingredients
  */
 public function getIngredient()
 {
     return $this->hasOne(Ingredient::className(), ['id' => 'ingredient_id']);
 }
Ejemplo n.º 2
0
 /**
  * Defines the relationship with the ingredients
  */
 public function getIngredients()
 {
     return $this->hasMany(Ingredient::className(), ['id' => 'ingredient_id'])->via('pizzaIngredients');
     // the relationship needs the junction table to work
 }