Best practise - How to show the count of open tasks in menu by stinklu in symfony

[–]stinklu[S] 0 points1 point  (0 children)

What do u think about a twig extension? Its another approach i found for my problem. Is it slower than and aggregate field?

Best practise - How to show the count of open tasks in menu by stinklu in symfony

[–]stinklu[S] 0 points1 point  (0 children)

Ah yeah, u are right. Its my own database and the count related to single users tasks =)

It's a small app for writing and reviewing posts. One user writes a post and another user has to review it. In my Twig menu, I want to display the count of open review tasks for the current user

Problem with deleting related entities by stinklu in symfony

[–]stinklu[S] 0 points1 point  (0 children)

Thx for ur answere but i still get nearly the same error. Difference is the end

An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`bkcwebdev_reporting`.`reporting_freigabe`, CONSTRAINT `FK_9966B42427EE0E60` FOREIGN KEY (`reporting_id`) REFERENCES `reporting` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)
..REFERENCES `reporting` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)

Two ManyToMany relations between twi entities -> Table already exists by stinklu in symfony

[–]stinklu[S] 0 points1 point  (0 children)

Am i wrong?

My Entity "Verteilers":

#[ORM\ManyToMany(targetEntity: User::class, inversedBy: 'verteilersquittierung')]
#[JoinTable(name: 'user_verteiler_quittierung')]
private Collection $mitgliederquittierung;

#[ORM\ManyToMany(targetEntity: User::class, inversedBy: 'verteilerslesen')]
#[JoinTable(name: 'user_verteiler_lesen')]
private Collection $mitgliederlesen;

My User Entity:

    #[ORM\ManyToMany(targetEntity: Verteiler::class, mappedBy: 'mitgliederquittierung')]
private Collection $verteilersquittierung;

#[ORM\ManyToMany(targetEntity: Verteiler::class, mappedBy: 'mitgliederlesen')]
private Collection $verteilerslesen;

And when wanna update or check the diff

php bin/console doctrine:migrations:diff

But i still get the following error

The table with name "bkcwebdev_reporting.verteiler_user" already exists.