mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-24 00:23:50 +00:00
add model + form to handle alt names
This commit is contained in:
@@ -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
|
||||
|
21
Resources/config/doctrine/PersonAltName.orm.yml
Normal file
21
Resources/config/doctrine/PersonAltName.orm.yml
Normal 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
|
4
Resources/config/services/alt_names.yml
Normal file
4
Resources/config/services/alt_names.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
services:
|
||||
Chill\PersonBundle\Config\ConfigPersonAltNamesHelper:
|
||||
arguments:
|
||||
$config: '%chill_person.person_fields.alt_names%'
|
@@ -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 }
|
||||
|
Reference in New Issue
Block a user