<?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#_Toc480452013
*
* Class OneRosterEnrollment
* @package Cms\CoreBundle\Entity\OneRoster
*
* @ORM\Entity(
* repositoryClass = "Cms\CoreBundle\Doctrine\OneRoster\OneRosterEnrollmentRepository"
* )
*/
class OneRosterEnrollment extends AbstractOneRosterEntity
{
const ONEROSTER_TYPE = 'enrollment';
const DISCR = 'Enrollment';
/**
* @var array|array[]|null
*
* @ORM\Column(
* type = "json",
* nullable = false,
* )
*/
protected ?array $user = null;
/**
* @var array|array[]|null
*
* @ORM\Column(
* type = "json",
* nullable = false,
* )
*/
protected ?array $class = null;
/**
* @var array|array[]|null
*
* @ORM\Column(
* type = "json",
* nullable = false,
* )
*/
protected ?array $school = null;
/**
* @see https://www.imsglobal.org/oneroster-v11-final-specification#_Toc480452025
*
* @var string|null
*
* @ORM\Column(
* type = "string",
* nullable = false,
* )
*/
protected ?string $role = null;
/**
* NOTE: the field must be given here with the backticks because it is a reserved word in mysql
*
* @var bool
*
* @ORM\Column(
* name = "`primary`",
* type = "boolean",
* nullable = false,
* options = {
* "default" = false,
* },
* )
*/
protected bool $primary = false;
/**
* @var DateTime|null
*
* @ORM\Column(
* type = "datetime",
* nullable = true,
* )
*/
protected ?DateTime $beginDate = null;
/**
* @var DateTime|null
*
* @ORM\Column(
* type = "datetime",
* nullable = true,
* )
*/
protected ?DateTime $endDate = null;
/**
* @return array|array[]|null
*/
public function getUser(): ?array
{
return $this->user;
}
/**
* @param array|array[] $value
* @return $this
*/
public function setUser(array $value): self
{
$this->user = $this->parseGuidRef($value);
return $this;
}
/**
* @return array|array[]|null
*/
public function getClass(): ?array
{
return $this->class;
}
/**
* @param array|array[] $value
* @return $this
*/
public function setClass(array $value): self
{
$this->class = $this->parseGuidRef($value);
return $this;
}
/**
* @return array|array[]|null
*/
public function getSchool(): ?array
{
return $this->school;
}
/**
* @param array|array[] $value
* @return $this
*/
public function setSchool(array $value): self
{
$this->school = $this->parseGuidRef($value);
return $this;
}
/**
* @return string|null
*/
public function getRole(): ?string
{
return $this->role;
}
/**
* @param string $value
* @return $this
*/
public function setRole(string $value): self
{
$this->role = $value;
return $this;
}
/**
* @return bool
*/
public function isPrimary(): bool
{
return $this->primary;
}
/**
* @param bool $value
* @return $this
*/
public function setPrimary(bool $value): self
{
$this->primary = $value;
return $this;
}
/**
* @return DateTime|null
*/
public function getBeginDate(): ?DateTime
{
return $this->beginDate;
}
/**
* @param DateTime|string|null $value
* @return $this
*/
public function setBeginDate($value): self
{
$this->beginDate = ($value) ? $this->parseDate($value) : null;
return $this;
}
/**
* @return DateTime|null
*/
public function getEndDate(): ?DateTime
{
return $this->endDate;
}
/**
* @param DateTime|string|null $value
* @return $this
*/
public function setEndDate($value): self
{
$this->endDate = ($value) ? $this->parseDate($value) : null;
return $this;
}
}