mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
merge exports branch into calendar branch
This commit is contained in:
@@ -36,49 +36,49 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface
|
||||
* inversedBy="comments")
|
||||
* @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
|
||||
*/
|
||||
private $accompanyingPeriod;
|
||||
private ?AccompanyingPeriod $accompanyingPeriod;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text")
|
||||
* @Groups({"read", "write"})
|
||||
* @Groups({"read", "write", "docgen:read"})
|
||||
* @Assert\NotBlank
|
||||
* @Assert\NotNull
|
||||
*/
|
||||
private $content;
|
||||
private ?string $content;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime")
|
||||
* @Groups({"read"})
|
||||
* @Groups({"read", "docgen:read"})
|
||||
*/
|
||||
private $createdAt;
|
||||
private ?DateTimeInterface $createdAt;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=User::class)
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
* @Groups({"read"})
|
||||
* @Groups({"read", "docgen:read"})
|
||||
*/
|
||||
private $creator;
|
||||
private ?User $creator;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
* @Groups({"read"})
|
||||
* @Groups({"read", "docgen:read"})
|
||||
*/
|
||||
private $id;
|
||||
private ?int $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime")
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
private $updatedAt;
|
||||
private ?DateTimeInterface $updatedAt;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=User::class)
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
private $updatedBy;
|
||||
private ?User $updatedBy;
|
||||
|
||||
public function getAccompanyingPeriod(): ?AccompanyingPeriod
|
||||
{
|
||||
|
@@ -47,7 +47,7 @@ class Resource
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
* @Groups({"read"})
|
||||
* @Groups({"read", "docgen:read"})
|
||||
*/
|
||||
private ?string $comment = '';
|
||||
|
||||
|
@@ -14,6 +14,7 @@ namespace Chill\PersonBundle\Entity\Household;
|
||||
use ArrayIterator;
|
||||
use Chill\MainBundle\Entity\Address;
|
||||
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\PersonBundle\Validator\Constraints\Household\MaxHolder;
|
||||
use DateTime;
|
||||
use DateTimeImmutable;
|
||||
@@ -354,7 +355,12 @@ class Household
|
||||
return $this->members;
|
||||
}
|
||||
|
||||
public function getMembersDuringMembership(HouseholdMember $membership)
|
||||
/**
|
||||
* get all the members during a given membership.
|
||||
*
|
||||
* @return Collection|HouseholdMember[]
|
||||
*/
|
||||
public function getMembersDuringMembership(HouseholdMember $membership): Collection
|
||||
{
|
||||
return $this->getMembersOnRange(
|
||||
$membership->getStartDate(),
|
||||
@@ -441,6 +447,28 @@ class Household
|
||||
return $this->getNonCurrentMembers($now)->matching($criteria);
|
||||
}
|
||||
|
||||
/**
|
||||
* get all the unique persons during a given membership.
|
||||
*
|
||||
* same as @see(self::getMembersDuringMembership}, except that the collection is filtered to
|
||||
* return unique members.
|
||||
*
|
||||
* @return Collection|Person[]
|
||||
*/
|
||||
public function getPersonsDuringMembership(HouseholdMember $member): Collection
|
||||
{
|
||||
// make list unique
|
||||
$membersByHash = [];
|
||||
|
||||
foreach ($this->getMembersDuringMembership($member) as $m) {
|
||||
if (null !== $m && null !== $m->getPerson()) {
|
||||
$membersByHash[spl_object_hash($m->getPerson())] = $m->getPerson();
|
||||
}
|
||||
}
|
||||
|
||||
return new ArrayCollection(array_values($membersByHash));
|
||||
}
|
||||
|
||||
public function getPreviousAddressOf(Address $address): ?Address
|
||||
{
|
||||
$iterator = new ArrayIterator($this->getAddressesOrdered());
|
||||
|
@@ -31,7 +31,6 @@ class MaritalStatus
|
||||
private ?string $id;
|
||||
|
||||
/**
|
||||
* @var string array
|
||||
* @ORM\Column(type="json")
|
||||
*/
|
||||
private array $name;
|
||||
|
@@ -1192,7 +1192,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use @link{Person::getCurrentPersonAddress} or @link{Person::getCurrentHouseholdAddress} instead
|
||||
* @deprecated Use @see{Person::getCurrentPersonAddress} or @see{Person::getCurrentHouseholdAddress} instead
|
||||
*
|
||||
* @throws Exception
|
||||
*
|
||||
|
Reference in New Issue
Block a user