symfony / symfony/maker-bundle

make:reset-password : Multiple entities

Open
#653 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature
Dominant language
PHP
Stars
3.4k
Forks
427
Avg merge
2d 22h
Merged PRs (30d)
20

Description

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 : https://github.com/SymfonyCasts/reset-password-bundle/issues/110#issuecomment-626244231

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the make:reset-password command and the reset_password.yaml configuration, then inspect the Entity\ResetPasswordRequest::user Doctrine annotation and the request repository mentioned in the issue. Determine how support for multiple user entities should be represented and how completion would be verified; the issue currently describes possible design directions without a settled implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, symfony
Domain
authentication, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.