mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
131 lines
2.1 KiB
PHP
131 lines
2.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/*
|
|
* Chill is a software for social workers
|
|
*
|
|
* For the full copyright and license information, please view
|
|
* the LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Chill\PersonBundle\Entity;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Symfony\Component\Serializer\Annotation\Groups;
|
|
|
|
/**
|
|
* PersonAltName.
|
|
*
|
|
* @ORM\Table(name="chill_person_alt_name")
|
|
* @ORM\Entity
|
|
*/
|
|
class PersonAltName
|
|
{
|
|
/**
|
|
* @var int
|
|
*
|
|
* @ORM\Column(name="id", type="integer")
|
|
* @ORM\Id
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
*/
|
|
private ?int $id = null;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="key", type="string", length=255)
|
|
* @Groups({"write"})
|
|
*/
|
|
private ?string $key = null;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="label", type="text")
|
|
* @Groups({"write"})
|
|
*/
|
|
private ?string $label = null;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(
|
|
* targetEntity="Chill\PersonBundle\Entity\Person",
|
|
* inversedBy="altNames"
|
|
* )
|
|
*/
|
|
private ?\Chill\PersonBundle\Entity\Person $person = null;
|
|
|
|
/**
|
|
* Get id.
|
|
*
|
|
* @return int
|
|
*/
|
|
public function getId()
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
/**
|
|
* Get key.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getKey()
|
|
{
|
|
return $this->key;
|
|
}
|
|
|
|
/**
|
|
* Get label.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getLabel()
|
|
{
|
|
return $this->label;
|
|
}
|
|
|
|
public function getPerson(): Person
|
|
{
|
|
return $this->person;
|
|
}
|
|
|
|
/**
|
|
* Set key.
|
|
*
|
|
* @param string $key
|
|
*
|
|
* @return PersonAltName
|
|
*/
|
|
public function setKey($key)
|
|
{
|
|
$this->key = $key;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Set label.
|
|
*
|
|
* @param string $label
|
|
*
|
|
* @return PersonAltName
|
|
*/
|
|
public function setLabel($label)
|
|
{
|
|
$this->label = $label;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return $this
|
|
*/
|
|
public function setPerson(?Person $person = null)
|
|
{
|
|
$this->person = $person;
|
|
|
|
return $this;
|
|
}
|
|
}
|