<?php
namespace Cms\CoreBundle\Entity\OneRoster;
use Cms\CoreBundle\Entity\AbstractOneRosterEntity;
use Doctrine\ORM\Mapping as ORM;
/**
* @see https://www.imsglobal.org/oneroster-v11-final-specification#_Toc480452016
*
* Class OneRosterOrg
* @package Cms\CoreBundle\Entity\OneRoster
*
* @ORM\Entity(
* repositoryClass = "Cms\CoreBundle\Doctrine\OneRoster\OneRosterOrgRepository"
* )
*/
class OneRosterOrg extends AbstractOneRosterEntity
{
const ONEROSTER_TYPE = 'org';
const DISCR = 'Org';
/**
* @var string|null
*
* @ORM\Column(
* type = "string",
* nullable = false,
* )
*/
protected ?string $name = null;
/**
* @see https://www.imsglobal.org/oneroster-v11-final-specification#_Toc480452024
*
* @var string|null
*
* @ORM\Column(
* type = "string",
* nullable = false,
* )
*/
protected ?string $type = null;
/**
* @var string|null
*
* @ORM\Column(
* type = "string",
* nullable = true,
* )
*/
protected ?string $identifier = 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 = [];
/**
* @return string|null
*/
public function getName(): ?string
{
return $this->name;
}
/**
* @param string $value
* @return $this
*/
public function setName(string $value): self
{
$this->name = $value;
return $this;
}
/**
* @param string $type
* @return bool
*/
public function isType(string $type): bool
{
return ($this->getType() === $type);
}
/**
* @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 string|null
*/
public function getIdentifier(): ?string
{
return $this->identifier;
}
/**
* @param string|null $value
* @return $this
*/
public function setIdentifier(?string $value): self
{
$this->identifier = $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->children = $this->parseGuidRefs($value ?? []);
return $this;
}
}