mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
cs: Fix code style (safe rules only).
This commit is contained in:
@@ -1,21 +1,38 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 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 Chill\PersonBundle\Entity\Person;
|
||||
use DateTime;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Person Phones
|
||||
* Person Phones.
|
||||
*
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="chill_person_phone",
|
||||
* indexes={
|
||||
* @ORM\Index(name="phonenumber", columns={"phonenumber"})
|
||||
* })
|
||||
* @ORM\Index(name="phonenumber", columns={"phonenumber"})
|
||||
* })
|
||||
*/
|
||||
class PersonPhone
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="datetime", nullable=false)
|
||||
*/
|
||||
private DateTime $date;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
private ?string $description = null;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
@@ -25,35 +42,35 @@ class PersonPhone
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="Chill\PersonBundle\Entity\Person",
|
||||
* inversedBy="otherPhoneNumbers"
|
||||
* 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)
|
||||
* @ORM\Column(type="text", length=40, nullable=true)
|
||||
*/
|
||||
private ?string $description = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime", nullable=false)
|
||||
*/
|
||||
private \DateTime $date;
|
||||
private ?string $type;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->date = new \DateTime();
|
||||
$this->date = new DateTime();
|
||||
}
|
||||
|
||||
public function getDate(): DateTime
|
||||
{
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
public function getDescription(): ?string
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
public function getId(): int
|
||||
@@ -66,9 +83,9 @@ class PersonPhone
|
||||
return $this->person;
|
||||
}
|
||||
|
||||
public function setPerson(Person $person): void
|
||||
public function getPhonenumber(): string
|
||||
{
|
||||
$this->person = $person;
|
||||
return $this->phonenumber;
|
||||
}
|
||||
|
||||
public function getType(): string
|
||||
@@ -76,24 +93,14 @@ class PersonPhone
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
public function setType(string $type): void
|
||||
public function isEmpty(): bool
|
||||
{
|
||||
$this->type = $type;
|
||||
return empty($this->getDescription()) && empty($this->getPhonenumber());
|
||||
}
|
||||
|
||||
public function getPhonenumber(): string
|
||||
public function setDate(DateTime $date): void
|
||||
{
|
||||
return $this->phonenumber;
|
||||
}
|
||||
|
||||
public function setPhonenumber(string $phonenumber): void
|
||||
{
|
||||
$this->phonenumber = $phonenumber;
|
||||
}
|
||||
|
||||
public function getDescription(): ?string
|
||||
{
|
||||
return $this->description;
|
||||
$this->date = $date;
|
||||
}
|
||||
|
||||
public function setDescription(?string $description): void
|
||||
@@ -101,18 +108,18 @@ class PersonPhone
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
public function getDate(): \DateTime
|
||||
public function setPerson(Person $person): void
|
||||
{
|
||||
return $this->date;
|
||||
$this->person = $person;
|
||||
}
|
||||
|
||||
public function setDate(\DateTime $date): void
|
||||
public function setPhonenumber(string $phonenumber): void
|
||||
{
|
||||
$this->date = $date;
|
||||
$this->phonenumber = $phonenumber;
|
||||
}
|
||||
|
||||
public function isEmpty(): bool
|
||||
public function setType(string $type): void
|
||||
{
|
||||
return empty($this->getDescription()) && empty($this->getPhonenumber());
|
||||
$this->type = $type;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user