mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
Merge remote-tracking branch 'origin/master' into issue471_activity_socialissue-action
This commit is contained in:
@@ -361,6 +361,8 @@ class AccompanyingPeriod implements
|
||||
*/
|
||||
private Collection $userHistories;
|
||||
|
||||
private bool $userIsChanged = false;
|
||||
|
||||
/**
|
||||
* Temporary field, which is filled when the user is changed.
|
||||
*
|
||||
@@ -978,6 +980,11 @@ class AccompanyingPeriod implements
|
||||
return null !== $this->userPrevious;
|
||||
}
|
||||
|
||||
public function isChangedUser(): bool
|
||||
{
|
||||
return $this->userIsChanged && $this->user !== $this->userPrevious;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the closing date is after the opening date.
|
||||
*/
|
||||
@@ -1103,6 +1110,14 @@ class AccompanyingPeriod implements
|
||||
$this->setStep(AccompanyingPeriod::STEP_CONFIRMED);
|
||||
}
|
||||
|
||||
public function resetPreviousUser(): self
|
||||
{
|
||||
$this->userPrevious = null;
|
||||
$this->userIsChanged = false;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Groups({"write"})
|
||||
*/
|
||||
@@ -1329,6 +1344,7 @@ class AccompanyingPeriod implements
|
||||
{
|
||||
if ($this->user !== $user) {
|
||||
$this->userPrevious = $this->user;
|
||||
$this->userIsChanged = true;
|
||||
|
||||
foreach ($this->userHistories as $history) {
|
||||
if (null === $history->getEndDate()) {
|
||||
|
@@ -57,6 +57,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
|
||||
* orphanRemoval=true
|
||||
* )
|
||||
* @Serializer\Groups({"read", "docgen:read"})
|
||||
* @ORM\OrderBy({"startDate": "DESC", "id": "DESC"})
|
||||
*
|
||||
* @internal /!\ the serialization for write evaluations is handled in `AccompanyingPeriodWorkDenormalizer`
|
||||
*/
|
||||
|
@@ -77,6 +77,7 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU
|
||||
* cascade={"remove", "persist"},
|
||||
* orphanRemoval=true
|
||||
* )
|
||||
* @ORM\OrderBy({"createdAt": "DESC", "id": "DESC"})
|
||||
* @Serializer\Groups({"read"})
|
||||
*/
|
||||
private Collection $documents;
|
||||
|
@@ -19,6 +19,7 @@ use DateTimeInterface;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
@@ -40,6 +41,8 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface
|
||||
/**
|
||||
* @ORM\Column(type="text")
|
||||
* @Groups({"read", "write"})
|
||||
* @Assert\NotBlank
|
||||
* @Assert\NotNull
|
||||
*/
|
||||
private $content;
|
||||
|
||||
|
@@ -151,6 +151,9 @@ class Household
|
||||
return $this->addresses;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array|Address[]
|
||||
*/
|
||||
public function getAddressesOrdered(): array
|
||||
{
|
||||
$addresses = $this->getAddresses()->toArray();
|
||||
|
Reference in New Issue
Block a user