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

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#_Toc480452009
  8.  *
  9.  * Class OneRosterAcademicSession
  10.  * @package Cms\CoreBundle\Entity\OneRoster
  11.  *
  12.  * @ORM\Entity(
  13.  *     repositoryClass = "Cms\CoreBundle\Doctrine\OneRoster\OneRosterAcademicSessionRepository"
  14.  * )
  15.  */
  16. class OneRosterAcademicSession extends AbstractOneRosterEntity
  17. {
  18.     const ONEROSTER_TYPE 'academicSession';
  19.     const DISCR 'AcademicSession';
  20.     /**
  21.      * @var string|null
  22.      *
  23.      * @ORM\Column(
  24.      *     type = "string",
  25.      *     nullable = false,
  26.      * )
  27.      */
  28.     protected ?string $title null;
  29.     /**
  30.      * @var DateTime|null
  31.      *
  32.      * @ORM\Column(
  33.      *     type = "datetime",
  34.      *     nullable = false,
  35.      * )
  36.      */
  37.     protected ?DateTime $startDate null;
  38.     /**
  39.      * @var DateTime|null
  40.      *
  41.      * @ORM\Column(
  42.      *     type = "datetime",
  43.      *     nullable = false,
  44.      * )
  45.      */
  46.     protected ?DateTime $endDate null;
  47.     /**
  48.      * @see https://www.imsglobal.org/oneroster-v11-final-specification#_Toc480452027
  49.      *
  50.      * @var string|null
  51.      *
  52.      * @ORM\Column(
  53.      *     type = "string",
  54.      *     nullable = false,
  55.      * )
  56.      */
  57.     protected ?string $type null;
  58.     /**
  59.      * @var array|null
  60.      *
  61.      * @ORM\Column(
  62.      *     type = "json",
  63.      *     nullable = true,
  64.      * )
  65.      */
  66.     protected ?array $parent null;
  67.     /**
  68.      * @var array|array[]
  69.      *
  70.      * @ORM\Column(
  71.      *     type = "json",
  72.      *     nullable = false,
  73.      * )
  74.      */
  75.     protected array $children = [];
  76.     /**
  77.      * @var int|null
  78.      *
  79.      * @ORM\Column(
  80.      *     type = "integer",
  81.      *     nullable = false,
  82.      * )
  83.      */
  84.     protected ?int $schoolYear null;
  85.     /**
  86.      * @return string|null
  87.      */
  88.     public function getTitle(): ?string
  89.     {
  90.         return $this->title;
  91.     }
  92.     /**
  93.      * @param string $value
  94.      * @return $this
  95.      */
  96.     public function setTitle(string $value): self
  97.     {
  98.         $this->title $value;
  99.         return $this;
  100.     }
  101.     /**
  102.      * @return DateTime|null
  103.      */
  104.     public function getStartDate(): ?DateTime
  105.     {
  106.         return $this->startDate;
  107.     }
  108.     /**
  109.      * @param string|DateTime $value
  110.      * @return $this
  111.      */
  112.     public function setStartDate($value): self
  113.     {
  114.         $this->startDate $this->parseDate($value);
  115.         return $this;
  116.     }
  117.     /**
  118.      * @return DateTime|null
  119.      */
  120.     public function getEndDate(): ?DateTime
  121.     {
  122.         return $this->endDate;
  123.     }
  124.     /**
  125.      * @param string|DateTime $value
  126.      * @return $this
  127.      */
  128.     public function setEndDate($value): self
  129.     {
  130.         $this->endDate $this->parseDate($value);
  131.         return $this;
  132.     }
  133.     /**
  134.      * @return string|null
  135.      */
  136.     public function getType(): ?string
  137.     {
  138.         return $this->type;
  139.     }
  140.     /**
  141.      * @param string $value
  142.      * @return $this
  143.      */
  144.     public function setType(string $value): self
  145.     {
  146.         $this->type $value;
  147.         return $this;
  148.     }
  149.     /**
  150.      * @return array|null
  151.      */
  152.     public function getParent(): ?array
  153.     {
  154.         return $this->parent;
  155.     }
  156.     /**
  157.      * @param array|null $value
  158.      * @return $this
  159.      */
  160.     public function setParent(?array $value): self
  161.     {
  162.         $this->parent = ($value) ? $this->parseGuidRef($value) : null;
  163.         return $this;
  164.     }
  165.     /**
  166.      * @return array|array[]
  167.      */
  168.     public function getChildren(): array
  169.     {
  170.         return $this->children;
  171.     }
  172.     /**
  173.      * @param array|array[]|null $value
  174.      * @return $this
  175.      */
  176.     public function setChildren(?array $value): self
  177.     {
  178.         $this->parseGuidRefs($value ?? []);
  179.         return $this;
  180.     }
  181.     /**
  182.      * @return int|null
  183.      */
  184.     public function getSchoolYear(): ?int
  185.     {
  186.         return $this->schoolYear;
  187.     }
  188.     /**
  189.      * @param int $value
  190.      * @return $this
  191.      */
  192.     public function setSchoolYear(int $value): self
  193.     {
  194.         $this->schoolYear $value;
  195.         return $this;
  196.     }
  197. }