Sto tentando di estendere FOS UserBundle per consentire alle entità di profilo esteso di contenere ulteriori informazioni oltre ai campi base di UserBundle. Poiché sul sito sono presenti più tipi di utenti, ho creato entità separate per conservare le informazioni del profilo. Ho le entità costituite come segue:Aggiunta di entità profilo estesa a FOS UserBundle
class UserProfile
{
/**
* @var integer
*/
private $id;
/**
* @var integer
*/
private $userId;
/**
* @var string
*/
private $phone;
/**
* @var string
*/
private $language;
/**
* @var string
*/
private $company;
/**
* @var string
*/
private $salutation;
/**
* @var string
*/
private $fax;
/**
* @var string
*/
private $region;
La mia configurazione
type: entity
table: user_profile
fields:
id:
type: integer
id: true
generator:
strategy: AUTO
phone:
type: string
length: '15'
language:
type: string
length: '50'
company:
type: string
length: 255
salutation:
type: string
length: '5'
fax:
type: string
length: '15'
region:
type: string
length: 255
oneToOne:
userId:
targetEntity: User
joinColumn:
name: user_id
referencedColumnName: id
lifecycleCallbacks: { }
Ho diversi altri tipi di utente con informazioni più specifiche che è drasticamente diverso, quindi ho bisogno le entità separate, per esempio I può avere un utente con 3 indirizzi, o ID dipendenti, ecc. Dato questo, come devo implementare il modulo di registrazione per creare informazioni sul profilo utente quando creo le informazioni UserBundle? Grazie in anticipo!