DDC-157: Dynamic cascade and fetch #194

Open
opened 2026-01-22 12:30:10 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Nov 19, 2009).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user reinier.kip:

Instead of rigidly setting cascade and fetch settings in the mapping, I suggest being able to dynamically request a certain cascades or fetch method. This would especially be of use with classes that have many relations and you want to eager fetch only a couple.
I think this can best be explained with an example:

// Relation: Group#users -< User

// Eager fetch a group's users
$group = $em->getRepository('Group')->findOneBy(1, array('users'));

// Persist a group and its users.
$em->persist($group, array('users'));
Originally created by @doctrinebot on GitHub (Nov 19, 2009). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user reinier.kip: Instead of rigidly setting cascade and fetch settings in the mapping, I suggest being able to dynamically request a certain cascades or fetch method. This would especially be of use with classes that have many relations and you want to eager fetch only a couple. I think this can best be explained with an example: ``` // Relation: Group#users -< User // Eager fetch a group's users $group = $em->getRepository('Group')->findOneBy(1, array('users')); // Persist a group and its users. $em->persist($group, array('users')); ```
admin added the New Feature label 2026-01-22 12:30:10 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#194