i'm trying use (and understand) how security works in symfony. i've created login form , works hard-coded users.
now want use existing user table in database. table has requiered fields different column names. entity exists, different names (for example "customuserid" instead of "id").
something (with "magic_mapping"):
/** * @orm\table(name="custom_user_table") * @orm\entity */ class user implements userinterface, \serializable { /** * @orm\column(name="customuserid", type="integer") * @orm\id * @orm\generatedvalue(strategy="identity") * @magic_mapping links mandatory "id" field */ private $customuserid; ... }
is there way map existing fields symfony uses them login purpose? or @ least can make work without changing database structure (only entity class)?
i've tried seleveral actions, forum , symfony documentation, ends ugly error can't fix.
any idea or lead? lot help, i've been struggling on several hours now...
you have change providers configuration inside security.yml file
here example, use email field administrator entity, think can same entity
providers: administrator: entity: { class: entity:administrator, property: email }
Comments
Post a Comment