You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SensorsBusiness.php 617B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace App\Http\Business;
  3. use App\Http\Business\Sensors\AbstractSensor;
  4. use App\Http\DBO\SensorsDbo;
  5. use App\Http\DBO\SensorTypesDbo;
  6. /**
  7. * Created by PhpStorm.
  8. * User: robin
  9. * Date: 11/23/15
  10. * Time: 11:59 PM
  11. */
  12. class SensorsBusiness
  13. {
  14. /**
  15. * @param SensorsDbo $sensor
  16. * @param SensorTypesDbo $type
  17. * @return mixed
  18. */
  19. public static function getValue(SensorsDbo $sensor, SensorTypesDbo $type)
  20. {
  21. /**
  22. * @var $sens AbstractSensor
  23. */
  24. $class = $type->getClass();
  25. $sens = new $class($sensor);
  26. return $sens->getValue();
  27. }
  28. }