Features/new phones

This commit is contained in:
Jean-Francois Monfort
2021-04-02 12:11:20 +00:00
committed by Julien Fastré
parent 6ea45e4d16
commit 27c680bb03
14 changed files with 502 additions and 123 deletions

View File

@@ -0,0 +1,115 @@
<?php
namespace Chill\PersonBundle\Entity;
use Chill\PersonBundle\Entity\Person;
use Doctrine\ORM\Mapping as ORM;
/**
* Person Phones
*
* @ORM\Entity()
* @ORM\Table(name="chill_person_phone")
*/
class PersonPhone
{
/**
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private ?int $id;
/**
* @ORM\ManyToOne(
* targetEntity="Chill\PersonBundle\Entity\Person",
* inversedBy="otherPhoneNumbers"
* )
*/
private Person $person;
/**
* @ORM\Column(type="text", length=40, nullable=true)
*/
private ?string $type;
/**
* @ORM\Column(type="text", length=40, nullable=false)
*/
private string $phonenumber = '';
/**
* @ORM\Column(type="text", nullable=true)
*/
private ?string $description = null;
/**
* @ORM\Column(type="datetime", nullable=false)
*/
private \DateTime $date;
public function __construct()
{
$this->date = new \DateTime();
}
public function getId(): int
{
return $this->id;
}
public function getPerson(): Person
{
return $this->person;
}
public function setPerson(Person $person): void
{
$this->person = $person;
}
public function getType(): string
{
return $this->type;
}
public function setType(string $type): void
{
$this->type = $type;
}
public function getPhonenumber(): string
{
return $this->phonenumber;
}
public function setPhonenumber(string $phonenumber): void
{
$this->phonenumber = $phonenumber;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): void
{
$this->description = $description;
}
public function getDate(): \DateTime
{
return $this->date;
}
public function setDate(\DateTime $date): void
{
$this->date = $date;
}
public function isEmpty(): bool
{
return empty($this->getDescription()) && empty($this->getPhonenumber());
}
}