vendor/novosga/core/Entity/Painel.php line 87

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Novo SGA project.
  4.  *
  5.  * (c) Rogerio Lino <rogeriolino@gmail.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Novosga\Entity;
  11. /**
  12.   * Painel
  13.   *
  14.   * @author Rogerio Lino <rogeriolino@gmail.com>
  15.   */
  16. class Painel implements \JsonSerializable
  17. {
  18.     /**
  19.      * @var int
  20.      */
  21.     private $host;
  22.     /**
  23.      * @var string
  24.      */
  25.     private $senha;
  26.     /**
  27.      * @var Unidade
  28.      */
  29.     private $unidade;
  30.     /**
  31.      * @var PainelServico[]
  32.      */
  33.     private $servicos;
  34.     public function getHost()
  35.     {
  36.         return $this->host;
  37.     }
  38.     public function setHost($host): self
  39.     {
  40.         $this->host $host;
  41.         return $this;
  42.     }
  43.     public function getUnidade()
  44.     {
  45.         return $this->unidade;
  46.     }
  47.     public function setUnidade($unidade): self
  48.     {
  49.         $this->unidade $unidade;
  50.         return $this;
  51.     }
  52.     public function getServicos()
  53.     {
  54.         return $this->servicos;
  55.     }
  56.     public function setServicos($servicos): self
  57.     {
  58.         $this->servicos $servicos;
  59.         
  60.         return $this;
  61.     }
  62.     public function getIp()
  63.     {
  64.         return long2ip($this->getHost());
  65.     }
  66.     public function __toString()
  67.     {
  68.         return $this->getIp();
  69.     }
  70.     public function jsonSerialize()
  71.     {
  72.         return [
  73.            'host'     => $this->getHost(),
  74.            'ip'       => $this->getIp(),
  75.            'servicos' => $this->getServicos(),
  76.         ];
  77.     }
  78. }