mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-07-01 14:36:13 +00:00
stylefix
This commit is contained in:
parent
c527b1b3cf
commit
5e7445a4fe
@ -459,6 +459,20 @@ class AccompanyingPeriod implements
|
|||||||
return end($periods) === $this;
|
return end($periods) === $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Assert\Callback
|
||||||
|
*/
|
||||||
|
public function canUserBeNull(ExecutionContextInterface $context)
|
||||||
|
{
|
||||||
|
if ($this->getStep() === self::STEP_CONFIRMED && $this->isConfidential() === true) {
|
||||||
|
if (!$this->getUser()) {
|
||||||
|
$context->buildViolation('User cannot be null for an accompanying period that is confirmed and confidential')
|
||||||
|
->atPath('user')
|
||||||
|
->addViolation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close a participation for a person.
|
* Close a participation for a person.
|
||||||
*
|
*
|
||||||
@ -871,21 +885,6 @@ class AccompanyingPeriod implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @Assert\Callback
|
|
||||||
*/
|
|
||||||
public function canUserBeNull(ExecutionContextInterface $context)
|
|
||||||
{
|
|
||||||
if ($this->getStep() === self::STEP_CONFIRMED && $this->isConfidential() === true)
|
|
||||||
{
|
|
||||||
if (!$this->getUser()) {
|
|
||||||
$context->buildViolation('User cannot be null for an accompanying period that is confirmed and confidential')
|
|
||||||
->atPath('user')
|
|
||||||
->addViolation();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function isEmergency(): bool
|
public function isEmergency(): bool
|
||||||
{
|
{
|
||||||
return $this->emergency;
|
return $this->emergency;
|
||||||
|
@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Tests\AccompanyingPeriod;
|
namespace Chill\PersonBundle\Tests\AccompanyingPeriod;
|
||||||
|
|
||||||
use Chill\MainBundle\Entity\User;
|
|
||||||
use Chill\MainBundle\Entity\Scope;
|
use Chill\MainBundle\Entity\Scope;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\Origin;
|
use Chill\MainBundle\Entity\User;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
|
use Chill\PersonBundle\Entity\AccompanyingPeriod\Origin;
|
||||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user