mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
csfixes plus changelog updated
This commit is contained in:
@@ -12,6 +12,8 @@ declare(strict_types=1);
|
||||
namespace Chill\PersonBundle\Entity;
|
||||
|
||||
use ArrayIterator;
|
||||
use Chill\BudgetBundle\Entity\Charge;
|
||||
use Chill\BudgetBundle\Entity\Resource;
|
||||
use Chill\MainBundle\Doctrine\Model\TrackCreationInterface;
|
||||
use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
|
||||
use Chill\MainBundle\Entity\Address;
|
||||
@@ -29,8 +31,6 @@ use Chill\PersonBundle\Entity\Person\PersonCurrentAddress;
|
||||
use Chill\PersonBundle\Validator\Constraints\Household\HouseholdMembershipSequential;
|
||||
use Chill\PersonBundle\Validator\Constraints\Person\Birthdate;
|
||||
use Chill\PersonBundle\Validator\Constraints\Person\PersonHasCenter;
|
||||
use Chill\BudgetBundle\Entity\Charge;
|
||||
use Chill\BudgetBundle\Entity\Resource;
|
||||
use DateTime;
|
||||
use DateTimeImmutable;
|
||||
use DateTimeInterface;
|
||||
@@ -38,7 +38,6 @@ use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\Common\Collections\Criteria;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Doctrine\ORM\PersistentCollection;
|
||||
use Exception;
|
||||
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
@@ -158,6 +157,26 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
*/
|
||||
private $birthdate;
|
||||
|
||||
/**
|
||||
* Read-only field, computed by the database.
|
||||
*
|
||||
* @ORM\OneToMany(
|
||||
* targetEntity=Charge::class,
|
||||
* mappedBy="person"
|
||||
* )
|
||||
*/
|
||||
private Collection $budgetCharges;
|
||||
|
||||
/**
|
||||
* Read-only field, computed by the database.
|
||||
*
|
||||
* @ORM\OneToMany(
|
||||
* targetEntity=Resource::class,
|
||||
* mappedBy="person"
|
||||
* )
|
||||
*/
|
||||
private Collection $budgetResources;
|
||||
|
||||
/**
|
||||
* The person's center.
|
||||
*
|
||||
@@ -486,26 +505,6 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
*/
|
||||
private $updatedBy;
|
||||
|
||||
/**
|
||||
* Read-only field, computed by the database.
|
||||
*
|
||||
* @ORM\OneToMany(
|
||||
* targetEntity=Resource::class,
|
||||
* mappedBy="person"
|
||||
* )
|
||||
*/
|
||||
private Collection $budgetResources;
|
||||
|
||||
/**
|
||||
* Read-only field, computed by the database.
|
||||
*
|
||||
* @ORM\OneToMany(
|
||||
* targetEntity=Charge::class,
|
||||
* mappedBy="person"
|
||||
* )
|
||||
*/
|
||||
private Collection $budgetCharges;
|
||||
|
||||
/**
|
||||
* Person constructor.
|
||||
*/
|
||||
@@ -564,16 +563,16 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addBudgetResource(Resource $budgetResource): self
|
||||
public function addBudgetCharge(Charge $budgetCharge): self
|
||||
{
|
||||
$this->budgetResources[] = $budgetResource;
|
||||
$this->budgetCharges[] = $budgetCharge;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addBudgetCharge(Charge $budgetCharge): self
|
||||
public function addBudgetResource(Resource $budgetResource): self
|
||||
{
|
||||
$this->budgetCharges[] = $budgetCharge;
|
||||
$this->budgetResources[] = $budgetResource;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -669,7 +668,6 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
*
|
||||
* Used in template, to find the participation when iterating on a list
|
||||
* of period.
|
||||
*
|
||||
*/
|
||||
public function findParticipationForPeriod(AccompanyingPeriod $period): ?AccompanyingPeriodParticipation
|
||||
{
|
||||
@@ -851,22 +849,6 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $this->addresses;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection|BudgetResources[]
|
||||
*/
|
||||
public function getBudgetResources(): Collection
|
||||
{
|
||||
return $this->budgetResources;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection|BudgetCharges[]
|
||||
*/
|
||||
public function getBudgetCharges(): Collection
|
||||
{
|
||||
return $this->budgetCharges;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the age of a person, calculated at the date 'now'.
|
||||
*
|
||||
@@ -897,6 +879,22 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $this->birthdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection|BudgetCharges[]
|
||||
*/
|
||||
public function getBudgetCharges(): Collection
|
||||
{
|
||||
return $this->budgetCharges;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection|BudgetResources[]
|
||||
*/
|
||||
public function getBudgetResources(): Collection
|
||||
{
|
||||
return $this->budgetResources;
|
||||
}
|
||||
|
||||
public function getCenter(): ?Center
|
||||
{
|
||||
return $this->center;
|
||||
@@ -1426,9 +1424,12 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
$this->addresses->removeElement($address);
|
||||
}
|
||||
|
||||
public function removeBudgetResource(Resource $budgetResource): self
|
||||
public function removeAltName(PersonAltName $altName): self
|
||||
{
|
||||
$this->budgetResources->removeElement($budgetResource);
|
||||
if ($this->altNames->contains($altName)) {
|
||||
$altName->setPerson(null);
|
||||
$this->altNames->removeElement($altName);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -1440,12 +1441,9 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeAltName(PersonAltName $altName): self
|
||||
public function removeBudgetResource(Resource $budgetResource): self
|
||||
{
|
||||
if ($this->altNames->contains($altName)) {
|
||||
$altName->setPerson(null);
|
||||
$this->altNames->removeElement($altName);
|
||||
}
|
||||
$this->budgetResources->removeElement($budgetResource);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
Reference in New Issue
Block a user