<?php
namespace Cms\CoreBundle\Entity\OneRoster;
use Cms\CoreBundle\Entity\AbstractOneRosterEntity;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
/**
* @see https://www.imsglobal.org/oneroster-v11-final-specification#_Toc480452009
*
* Class OneRosterAcademicSession
* @package Cms\CoreBundle\Entity\OneRoster
*
* @ORM\Entity(
* repositoryClass = "Cms\CoreBundle\Doctrine\OneRoster\OneRosterAcademicSessionRepository"
* )
*/
class OneRosterAcademicSession extends AbstractOneRosterEntity
{
const ONEROSTER_TYPE = 'academicSession';
const DISCR = 'AcademicSession';
/**
* @var string|null
*
* @ORM\Column(
* type = "string",
* nullable = false,
* )
*/
protected ?string $title = null;
/**
* @var DateTime|null
*
* @ORM\Column(
* type = "datetime",
* nullable = false,
* )
*/
protected ?DateTime $startDate = null;
/**
* @var DateTime|null
*
* @ORM\Column(
* type = "datetime",
* nullable = false,
* )
*/
protected ?DateTime $endDate = null;
/**
* @see https://www.imsglobal.org/oneroster-v11-final-specification#_Toc480452027
*
* @var string|null
*
* @ORM\Column(
* type = "string",
* nullable = false,
* )
*/
protected ?string $type = null;
/**
* @var array|null
*
* @ORM\Column(
* type = "json",
* nullable = true,
* )
*/
protected ?array $parent = null;
/**
* @var array|array[]
*
* @ORM\Column(
* type = "json",
* nullable = false,
* )
*/
protected array $children = [];
/**
* @var int|null
*
* @ORM\Column(
* type = "integer",
* nullable = false,
* )
*/
protected ?int $schoolYear = null;
/**
* @return string|null
*/
public function getTitle(): ?string
{
return $this->title;
}
/**
* @param string $value
* @return $this
*/
public function setTitle(string $value): self
{
$this->title = $value;
return $this;
}
/**
* @return DateTime|null
*/
public function getStartDate(): ?DateTime
{
return $this->startDate;
}
/**
* @param string|DateTime $value
* @return $this
*/
public function setStartDate($value): self
{
$this->startDate = $this->parseDate($value);
return $this;
}
/**
* @return DateTime|null
*/
public function getEndDate(): ?DateTime
{
return $this->endDate;
}
/**
* @param string|DateTime $value
* @return $this
*/
public function setEndDate($value): self
{
$this->endDate = $this->parseDate($value);
return $this;
}
/**
* @return string|null
*/
public function getType(): ?string
{
return $this->type;
}
/**
* @param string $value
* @return $this
*/
public function setType(string $value): self
{
$this->type = $value;
return $this;
}
/**
* @return array|null
*/
public function getParent(): ?array
{
return $this->parent;
}
/**
* @param array|null $value
* @return $this
*/
public function setParent(?array $value): self
{
$this->parent = ($value) ? $this->parseGuidRef($value) : null;
return $this;
}
/**
* @return array|array[]
*/
public function getChildren(): array
{
return $this->children;
}
/**
* @param array|array[]|null $value
* @return $this
*/
public function setChildren(?array $value): self
{
$this->parseGuidRefs($value ?? []);
return $this;
}
/**
* @return int|null
*/
public function getSchoolYear(): ?int
{
return $this->schoolYear;
}
/**
* @param int $value
* @return $this
*/
public function setSchoolYear(int $value): self
{
$this->schoolYear = $value;
return $this;
}
}