add model + form to handle alt names

This commit is contained in:
2020-01-30 15:51:39 +01:00
parent 7b7ce4a604
commit 426458811c
14 changed files with 482 additions and 2 deletions

View File

@@ -74,6 +74,11 @@ Chill\PersonBundle\Entity\Person:
targetEntity: AccompanyingPeriod
mappedBy: person
cascade: [persist, remove, merge, detach]
altNames:
targetEntity: PersonAltName
mappedBy: person
cascade: [persist, remove, merge, detach]
orphanRemoval: true
manyToMany:
spokenLanguages:
targetEntity: Chill\MainBundle\Entity\Language

View File

@@ -0,0 +1,21 @@
Chill\PersonBundle\Entity\PersonAltName:
type: entity
table: chill_person_alt_name
repositoryClass: Chill\PersonBundle\Repository\PersonAltNameRepository
id:
id:
type: integer
id: true
generator:
strategy: AUTO
fields:
key:
type: string
length: 255
label:
type: text
manyToOne:
person:
targetEntity: Person
inversedBy: altNames

View File

@@ -0,0 +1,4 @@
services:
Chill\PersonBundle\Config\ConfigPersonAltNamesHelper:
arguments:
$config: '%chill_person.person_fields.alt_names%'

View File

@@ -3,6 +3,7 @@ services:
class: Chill\PersonBundle\Form\PersonType
arguments:
- "%chill_person.person_fields%"
- '@Chill\PersonBundle\Config\ConfigPersonAltNamesHelper'
tags:
- { name: form.type }
@@ -29,3 +30,10 @@ services:
- '@Symfony\Component\Translation\TranslatorInterface'
tags:
- { name: form.type }
Chill\PersonBundle\Form\Type\PersonAltNameType:
arguments:
$configHelper: '@Chill\PersonBundle\Config\ConfigPersonAltNamesHelper'
$translatableStringHelper: '@chill.main.helper.translatable_string'
tags:
- { name: form.type }