src/Cms/CoreBundle/Entity/OneRoster/OneRosterOrg.php line 19

Open in your IDE?
  1. <?php
  2. namespace Cms\CoreBundle\Entity\OneRoster;
  3. use Cms\CoreBundle\Entity\AbstractOneRosterEntity;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @see https://www.imsglobal.org/oneroster-v11-final-specification#_Toc480452016
  7.  *
  8.  * Class OneRosterOrg
  9.  * @package Cms\CoreBundle\Entity\OneRoster
  10.  *
  11.  * @ORM\Entity(
  12.  *     repositoryClass = "Cms\CoreBundle\Doctrine\OneRoster\OneRosterOrgRepository"
  13.  * )
  14.  */
  15. class OneRosterOrg extends AbstractOneRosterEntity
  16. {
  17.     const ONEROSTER_TYPE 'org';
  18.     const DISCR 'Org';
  19.     /**
  20.      * @var string|null
  21.      *
  22.      * @ORM\Column(
  23.      *     type = "string",
  24.      *     nullable = false,
  25.      * )
  26.      */
  27.     protected ?string $name null;
  28.     /**
  29.      * @see https://www.imsglobal.org/oneroster-v11-final-specification#_Toc480452024
  30.      *
  31.      * @var string|null
  32.      *
  33.      * @ORM\Column(
  34.      *     type = "string",
  35.      *     nullable = false,
  36.      * )
  37.      */
  38.     protected ?string $type null;
  39.     /**
  40.      * @var string|null
  41.      *
  42.      * @ORM\Column(
  43.      *     type = "string",
  44.      *     nullable = true,
  45.      * )
  46.      */
  47.     protected ?string $identifier null;
  48.     /**
  49.      * @var array|null
  50.      *
  51.      * @ORM\Column(
  52.      *     type = "json",
  53.      *     nullable = true,
  54.      * )
  55.      */
  56.     protected ?array $parent null;
  57.     /**
  58.      * @var array|array[]
  59.      *
  60.      * @ORM\Column(
  61.      *     type = "json",
  62.      *     nullable = false,
  63.      * )
  64.      */
  65.     protected array $children = [];
  66.     /**
  67.      * @return string|null
  68.      */
  69.     public function getName(): ?string
  70.     {
  71.         return $this->name;
  72.     }
  73.     /**
  74.      * @param string $value
  75.      * @return $this
  76.      */
  77.     public function setName(string $value): self
  78.     {
  79.         $this->name $value;
  80.         return $this;
  81.     }
  82.     /**
  83.      * @param string $type
  84.      * @return bool
  85.      */
  86.     public function isType(string $type): bool
  87.     {
  88.         return ($this->getType() === $type);
  89.     }
  90.     /**
  91.      * @return string|null
  92.      */
  93.     public function getType(): ?string
  94.     {
  95.         return $this->type;
  96.     }
  97.     /**
  98.      * @param string $value
  99.      * @return $this
  100.      */
  101.     public function setType(string $value): self
  102.     {
  103.         $this->type $value;
  104.         return $this;
  105.     }
  106.     /**
  107.      * @return string|null
  108.      */
  109.     public function getIdentifier(): ?string
  110.     {
  111.         return $this->identifier;
  112.     }
  113.     /**
  114.      * @param string|null $value
  115.      * @return $this
  116.      */
  117.     public function setIdentifier(?string $value): self
  118.     {
  119.         $this->identifier $value;
  120.         return $this;
  121.     }
  122.     /**
  123.      * @return array|null
  124.      */
  125.     public function getParent(): ?array
  126.     {
  127.         return $this->parent;
  128.     }
  129.     /**
  130.      * @param array|null $value
  131.      * @return $this
  132.      */
  133.     public function setParent(?array $value): self
  134.     {
  135.         $this->parent = ($value) ? $this->parseGuidRef($value) : null;
  136.         return $this;
  137.     }
  138.     /**
  139.      * @return array|array[]
  140.      */
  141.     public function getChildren(): array
  142.     {
  143.         return $this->children;
  144.     }
  145.     /**
  146.      * @param array|array[]|null $value
  147.      * @return $this
  148.      */
  149.     public function setChildren(?array $value): self
  150.     {
  151.         $this->children $this->parseGuidRefs($value ?? []);
  152.         return $this;
  153.     }
  154. }