Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

22 lines
374B

  1. <?php
  2. namespace Lc\CaracoleBundle\Solver\Config;
  3. use Lc\CaracoleBundle\Model\Config\UnitInterface;
  4. class UnitSolver
  5. {
  6. public function getWeight(UnitInterface $unit, float $quantityProduct, ?int $quantity){
  7. if($quantity) {
  8. return ($quantityProduct / $unit->getCoefficient()) * $quantity;
  9. }else{
  10. return 0;
  11. }
  12. }
  13. }