mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-03-11 08:27:44 +00:00
Add Person's external identifiers to creation and edit form
This commit is contained in:
@@ -15,7 +15,7 @@ use Chill\PersonBundle\Entity\Identifier\PersonIdentifier;
|
||||
use Chill\PersonBundle\Entity\Identifier\PersonIdentifierDefinition;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final readonly class PersonIdentifierWorker
|
||||
readonly class PersonIdentifierWorker
|
||||
{
|
||||
public function __construct(
|
||||
private PersonIdentifierEngineInterface $identifierEngine,
|
||||
@@ -46,4 +46,25 @@ final readonly class PersonIdentifierWorker
|
||||
{
|
||||
return $this->identifierEngine->renderAsString($identifier, $this->definition);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the identifier must be considered as empty.
|
||||
*/
|
||||
public function isEmpty(PersonIdentifier $identifier): bool
|
||||
{
|
||||
return $this->identifierEngine->isEmpty($identifier);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<IdentifierViolationDTO>
|
||||
*/
|
||||
public function validate(PersonIdentifier $identifier, PersonIdentifierDefinition $definition): array
|
||||
{
|
||||
return $this->identifierEngine->validate($identifier, $definition);
|
||||
}
|
||||
|
||||
public function getDefaultValue(): array
|
||||
{
|
||||
return $this->identifierEngine->getDefaultValue($this->definition);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user