This commit is contained in:
Julie Lenaerts 2022-01-26 12:01:14 +01:00
parent 51ab013bd7
commit ce3a74326d

View File

@ -261,13 +261,15 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
/**
* @Assert\Callback
*
* @param mixed $payload
*/
public function validate(ExecutionContextInterface $context, $payload)
{
if ($this->person === null && $this->thirdParty === null && $this->freeText === null ) {
if (null === $this->person && null === $this->thirdParty && null === $this->freeText) {
$context->buildViolation('You must associate at least one entity')
->atPath('person')
->addViolation();
->atPath('person')
->addViolation();
}
}
}