src/Service/Reports/ParamsDTO.php line 45

Open in your IDE?
  1. <?php
  2. namespace App\Service\Reports;
  3. class ParamsDTO implements \JsonSerializable {
  4.     private $name;
  5.     private $value;
  6.     /**
  7.      * @return mixed
  8.      */
  9.     public function getName() {
  10.         return $this->name;
  11.     }
  12.     /**
  13.      * @param mixed $name
  14.      */
  15.     public function setName($name): void {
  16.         $this->name $name;
  17.     }
  18.     /**
  19.      * @return mixed
  20.      */
  21.     public function getValue() {
  22.         return $this->value;
  23.     }
  24.     /**
  25.      * @param mixed $value
  26.      */
  27.     public function setValue($value): void {
  28.         $this->value $value;
  29.     }
  30.     public static function fromPair($name$value) {
  31.         $paramsDto = new ParamsDTO();
  32.         $paramsDto->setName($name);
  33.         $paramsDto->setValue($value);
  34.         return $paramsDto;
  35.     }
  36.     public function jsonSerialize() {
  37.         return [
  38.             "name" => $this->name,
  39.             "value" => $this->value,
  40.         ];
  41.     }
  42. }