src/Cms/CoreBundle/Entity/OneRoster/OneRosterEnrollment.php line 20

Open in your IDE?
  1. <?php
  2. namespace Cms\CoreBundle\Entity\OneRoster;
  3. use Cms\CoreBundle\Entity\AbstractOneRosterEntity;
  4. use DateTime;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @see https://www.imsglobal.org/oneroster-v11-final-specification#_Toc480452013
  8.  *
  9.  * Class OneRosterEnrollment
  10.  * @package Cms\CoreBundle\Entity\OneRoster
  11.  *
  12.  * @ORM\Entity(
  13.  *     repositoryClass = "Cms\CoreBundle\Doctrine\OneRoster\OneRosterEnrollmentRepository"
  14.  * )
  15.  */
  16. class OneRosterEnrollment extends AbstractOneRosterEntity
  17. {
  18.     const ONEROSTER_TYPE 'enrollment';
  19.     const DISCR 'Enrollment';
  20.     /**
  21.      * @var array|array[]|null
  22.      *
  23.      * @ORM\Column(
  24.      *     type = "json",
  25.      *     nullable = false,
  26.      * )
  27.      */
  28.     protected ?array $user null;
  29.     /**
  30.      * @var array|array[]|null
  31.      *
  32.      * @ORM\Column(
  33.      *     type = "json",
  34.      *     nullable = false,
  35.      * )
  36.      */
  37.     protected ?array $class null;
  38.     /**
  39.      * @var array|array[]|null
  40.      *
  41.      * @ORM\Column(
  42.      *     type = "json",
  43.      *     nullable = false,
  44.      * )
  45.      */
  46.     protected ?array $school null;
  47.     /**
  48.      * @see https://www.imsglobal.org/oneroster-v11-final-specification#_Toc480452025
  49.      *
  50.      * @var string|null
  51.      *
  52.      * @ORM\Column(
  53.      *     type = "string",
  54.      *     nullable = false,
  55.      * )
  56.      */
  57.     protected ?string $role null;
  58.     /**
  59.      * NOTE: the field must be given here with the backticks because it is a reserved word in mysql
  60.      *
  61.      * @var bool
  62.      *
  63.      * @ORM\Column(
  64.      *     name = "`primary`",
  65.      *     type = "boolean",
  66.      *     nullable = false,
  67.      *     options = {
  68.      *         "default" = false,
  69.      *     },
  70.      * )
  71.      */
  72.     protected bool $primary false;
  73.     /**
  74.      * @var DateTime|null
  75.      *
  76.      * @ORM\Column(
  77.      *     type = "datetime",
  78.      *     nullable = true,
  79.      * )
  80.      */
  81.     protected ?DateTime $beginDate null;
  82.     /**
  83.      * @var DateTime|null
  84.      *
  85.      * @ORM\Column(
  86.      *     type = "datetime",
  87.      *     nullable = true,
  88.      * )
  89.      */
  90.     protected ?DateTime $endDate null;
  91.     /**
  92.      * @return array|array[]|null
  93.      */
  94.     public function getUser(): ?array
  95.     {
  96.         return $this->user;
  97.     }
  98.     /**
  99.      * @param array|array[] $value
  100.      * @return $this
  101.      */
  102.     public function setUser(array $value): self
  103.     {
  104.         $this->user $this->parseGuidRef($value);
  105.         return $this;
  106.     }
  107.     /**
  108.      * @return array|array[]|null
  109.      */
  110.     public function getClass(): ?array
  111.     {
  112.         return $this->class;
  113.     }
  114.     /**
  115.      * @param array|array[] $value
  116.      * @return $this
  117.      */
  118.     public function setClass(array $value): self
  119.     {
  120.         $this->class $this->parseGuidRef($value);
  121.         return $this;
  122.     }
  123.     /**
  124.      * @return array|array[]|null
  125.      */
  126.     public function getSchool(): ?array
  127.     {
  128.         return $this->school;
  129.     }
  130.     /**
  131.      * @param array|array[] $value
  132.      * @return $this
  133.      */
  134.     public function setSchool(array $value): self
  135.     {
  136.         $this->school $this->parseGuidRef($value);
  137.         return $this;
  138.     }
  139.     /**
  140.      * @return string|null
  141.      */
  142.     public function getRole(): ?string
  143.     {
  144.         return $this->role;
  145.     }
  146.     /**
  147.      * @param string $value
  148.      * @return $this
  149.      */
  150.     public function setRole(string $value): self
  151.     {
  152.         $this->role $value;
  153.         return $this;
  154.     }
  155.     /**
  156.      * @return bool
  157.      */
  158.     public function isPrimary(): bool
  159.     {
  160.         return $this->primary;
  161.     }
  162.     /**
  163.      * @param bool $value
  164.      * @return $this
  165.      */
  166.     public function setPrimary(bool $value): self
  167.     {
  168.         $this->primary $value;
  169.         return $this;
  170.     }
  171.     /**
  172.      * @return DateTime|null
  173.      */
  174.     public function getBeginDate(): ?DateTime
  175.     {
  176.         return $this->beginDate;
  177.     }
  178.     /**
  179.      * @param DateTime|string|null $value
  180.      * @return $this
  181.      */
  182.     public function setBeginDate($value): self
  183.     {
  184.         $this->beginDate = ($value) ? $this->parseDate($value) : null;
  185.         return $this;
  186.     }
  187.     /**
  188.      * @return DateTime|null
  189.      */
  190.     public function getEndDate(): ?DateTime
  191.     {
  192.         return $this->endDate;
  193.     }
  194.     /**
  195.      * @param DateTime|string|null $value
  196.      * @return $this
  197.      */
  198.     public function setEndDate($value): self
  199.     {
  200.         $this->endDate = ($value) ? $this->parseDate($value) : null;
  201.         return $this;
  202.     }
  203. }