Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

make:reset-password : Multiple entities #653

Open
alexis78-sym opened this issue Jul 31, 2020 · 1 comment 路 May be fixed by #1527
Open

make:reset-password : Multiple entities #653

alexis78-sym opened this issue Jul 31, 2020 · 1 comment 路 May be fixed by #1527
Labels
Feature New Feature

Comments

@alexis78-sym
Copy link

Hi 馃槃,

It would be great if we could handle multiple entities with this Reset Password.

@jrushlow said :

[...] But off the top of my head, the reset_password.yaml file wouldn't change if you wanted to use multiple user entities. It just needs to know what repository to use for the ResetPasswordRequest entity. Which there should only be 1 of those.

What would change would be the Entity\ResetPasswordRequest::user Doctrine Annotation. make:reset-password does something like @ORM\ManyToOne(targetEntity="App\Entity\User") for that property.

If you have multiple entities, you couldn't use a ManyToOne relation. Knee jerk thinking would be the request entity would need a new property(ies) to track which user "type" (entity) and the id of the user. Then in the request repository, you would use the new properties to fetch and set Entity\ResetPasswordRequest::user with the correct user entity before returning the Entity\ResetPasswordRequest::class to the consumer.

View : SymfonyCasts/reset-password-bundle#110 (comment)

@jrushlow jrushlow added the Feature New Feature label Oct 31, 2020
@jrushlow
Copy link
Collaborator

Note to self: reference SymfonyCasts/reset-password-bundle#318

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New Feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants