I am trying to set whole registration process in my Symfony 6 project following the documentation.
I come to the part where I have a form that I am populating. When submited, I get an error:
Unable to find the object manager associated with an entity of class “AppEntityUser”.
I strictly followed the example that is given in the documentation.
And in my user entity:
/**
* @ORMTable(name="`user`")
* @ORMEntity(repositoryClass="AppRepositoryUserRepository")
* @UniqueEntity(fields={"email"}, message="There is already an account with this email")
*/
class User implements UserInterface, PasswordAuthenticatedUserInterface
{
....
And in the doctrine.yaml file:
orm:
auto_generate_proxy_classes: true
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
auto_mapping: true
mappings:
App:
is_bundle: false
dir: '%kernel.project_dir%/src/Entity'
prefix: 'AppEntity'
alias: App
UserRepository:
/**
* @extends ServiceEntityRepository<User>
*
* @method User|null find($id, $lockMode = null, $lockVersion = null)
* @method User|null findOneBy(array $criteria, array $orderBy = null)
* @method User[] findAll()
* @method User[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class UserRepository extends ServiceEntityRepository implements PasswordUpgraderInterface
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, User::class);
}
...
What am I doing wrong?