P
P
postgresdev2019-10-15 23:10:58
symfony
postgresdev, 2019-10-15 23:10:58

How to get single column values ​​from ArrayCollection in Symfony?

There is an ArrayCollection with a large number of enitities, how to get their ids. Ideally use one of the array collection methods

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2019-10-16
@postgresdev

You need to call the map() method and pass in an anonymous function that takes an entity and returns its id. As a result , you will get a collection of id of these entities
https://www.doctrine-project.org/api/collections/l...
iterations take the id of the entity and work with it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question