Example #1
0
 public function getPrices()
 {
     $RPrice = RPrice::find()->where(["id_item" => $this->id_item])->all();
     $result = false;
     foreach ($RPrice as $price) {
         $result[$price->id_unit] = $price->value;
     }
     return $result;
 }
Example #2
0
 public function getPrices()
 {
     return $this->hasMany(RPrice::className(), ['id_item' => 'id']);
 }