Proposal: Implement extra_lazy for collection->getKeys() #5080

Open
opened 2026-01-22 14:57:49 +01:00 by admin · 1 comment
Owner

Originally created by @mrVrAlex on GitHub (Apr 1, 2016).

Hi, Guys!
I want propose make for all extra_lazy associations, something like this:

$sql = 'SELECT indexBy FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses);
return (array) $this->conn->fetchColumn($sql, $params, 0, $types);

This should return an array IDs by simple SQL instead loop (and hydrate!) all collection.

Originally created by @mrVrAlex on GitHub (Apr 1, 2016). Hi, Guys! I want propose make for all extra_lazy associations, something like this: ``` $sql = 'SELECT indexBy FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); return (array) $this->conn->fetchColumn($sql, $params, 0, $types); ``` This should return an array IDs by simple SQL instead loop (and hydrate!) all collection.
Author
Owner

@DHager commented on GitHub (Apr 6, 2016):

Makes sense, although I've avoided keyed-collections because AFAIK when you update items (or flush them to get an auto-generated ID) the association-keys may be stale or inconsistent.

@DHager commented on GitHub (Apr 6, 2016): Makes sense, although I've avoided keyed-collections because AFAIK when you update items (or flush them to get an auto-generated ID) the association-keys may be stale or inconsistent.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5080