S
S
Stanislav Shendakov2020-11-02 06:25:12
symfony
Stanislav Shendakov, 2020-11-02 06:25:12

Symfony, easyadmin why records are not deleted?

Good afternoon. I continue to master Symfony in general EasyAdmin and Doctrine in particular. There is a table OrgNews with organization news. This table has an AuthorID field, they are related like this:

...
namespace App\Entity;
...
/**
     * @ORM\OneToOne(targetEntity=OrgUser::class)
     */
    private $AuthorID;
...

there is also a foreign key: 5f9f7b6d17346386602798.jpeg

News is being created. But when I try to delete the news, nothing happens. I suspect it's a table relationship issue. Please advise. Am I setting up the links incorrectly? After all, each user can have a lot of news. Those. need to set up a "Many to one" link? So is org_user related to system_user? Could this be related? If more details are needed, I'll post it.
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Latukhin, 2020-11-02
@aleksandr97

You're getting an error because of the fk delimiter, you need to set up a cascading delete

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question