D
D
Danil Razumkov2018-08-10 18:10:54
symfony
Danil Razumkov, 2018-08-10 18:10:54

OneToMany Doctrine Symfony 4 how to remove all Many from One?

I have a User object that can write articles. But if I, as an admin, did not like the article, then I delete all his articles with one button.
One: User
Many: Articles

Question : how to implement it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Scream Ninja, 2019-09-17
@screamninja

@OneToMany(targetEntity="Article", mappedBy="user", cascade={"all"})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question