This commit is contained in:
Julie Lenaerts 2022-01-26 12:01:14 +01:00
parent 5d7501d36e
commit ed00a882af

View File

@ -261,13 +261,15 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
/** /**
* @Assert\Callback * @Assert\Callback
*
* @param mixed $payload
*/ */
public function validate(ExecutionContextInterface $context, $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') $context->buildViolation('You must associate at least one entity')
->atPath('person') ->atPath('person')
->addViolation(); ->addViolation();
} }
} }
} }