some tweaks into PickAddressType

This commit is contained in:
2021-10-14 13:54:19 +02:00
parent 6fccc70e41
commit 9a02665053
6 changed files with 40 additions and 39 deletions

View File

@@ -89,28 +89,6 @@ class ThirdPartyType extends AbstractType
])
;
/*
$builder
/*
->add('address', HiddenType::class)
->get('address')
->addModelTransformer(new CallbackTransformer(
function (?Address $address): string {
if (null === $address) {
return '';
}
return $address->getId();
},
function (?string $addressId): ?Address {
if (null === $addressId) {
return null;
}
return $this->om
->getRepository(Address::class)
->findOneBy(['id' => (int) $addressId]);
}
))*/
// Contact Person ThirdParty (child)
if (ThirdParty::KIND_CONTACT === $options['kind'] || ThirdParty::KIND_CHILD === $options['kind']) {
$builder
@@ -152,6 +130,12 @@ class ThirdPartyType extends AbstractType
->add('address', PickAddressType::class, [
'label' => 'Address'
])
->add('address2', PickAddressType::class, [
'label' => 'Address',
'use_valid_from' => true,
'use_valid_to' => true,
'mapped' => false,
])
->add('nameCompany', TextType::class, [
'label' => 'thirdparty.NameCompany',
'required' => false