Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

UnitSolver.php 387B

2 anos atrás
2 anos atrás
123456789101112131415161718
  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, ?float $quantity)
  7. {
  8. if ($quantity) {
  9. return ($quantityProduct / $unit->getCoefficient()) * $quantity;
  10. }
  11. else {
  12. return 0;
  13. }
  14. }
  15. }