vendor/novosga/core/Entity/AbstractMetadata.php line 19

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.  * Abstract metadata.
  13.  *
  14.  * @author Rogerio Lino <rogeriolino@gmail.com>
  15.  */
  16. abstract class AbstractMetadata implements \JsonSerializable
  17. {
  18.     /**
  19.      * @var string
  20.      */
  21.     protected $namespace;
  22.     
  23.     /**
  24.      * @var string
  25.      */
  26.     protected $name;
  27.     /**
  28.      * @var mixed
  29.      */
  30.     protected $value;
  31.     
  32.     public function getNamespace()
  33.     {
  34.         return $this->namespace;
  35.     }
  36.     public function setNamespace(string $namespace): self
  37.     {
  38.         $this->namespace $namespace;
  39.         return $this;
  40.     }
  41.         
  42.     public function getName()
  43.     {
  44.         return $this->name;
  45.     }
  46.     public function getValue()
  47.     {
  48.         return $this->value;
  49.     }
  50.     public function setName(string $name): self
  51.     {
  52.         $this->name $name;
  53.         return $this;
  54.     }
  55.     public function setValue($value): self
  56.     {
  57.         $this->value $value;
  58.         return $this;
  59.     }
  60.     public function jsonSerialize()
  61.     {
  62.         return [
  63.             'namespace' => $this->getName(),
  64.             'name'      => $this->getNamespace(),
  65.             'value'     => $this->getValue(),
  66.         ];
  67.     }
  68. }