doc(doctrine): document how to compute and sort a virtual field#7113
doc(doctrine): document how to compute and sort a virtual field#7113soyuka merged 1 commit intoapi-platform:4.1from
Conversation
|
Clever! We should really rename "handleLinks" if we use it like that, it's not related at all to links now :) |
Maybe that we should add something like It'd be even better and one could use the same query builder but still handle links on subresources. |
|
I suspect that the current solution has a drawback, how can we substitute the data of the current authorized user into this request? for example, if we need to look at the total of only a multiple of the current authorized user I think this problem will be solved if we switch to repository methods and not methods for getting in the entity itself |
|
so #7115 would be more appropriate? Can you share an example? |
This PR introduces the ability to use and filter on computed fields within API Platform, specifically for Doctrine entities.
Here's a configuration example with a filter and static functions :
A new functional test (
ComputedFieldTest.php) demonstrating the usage which will be transformed into a guide.