I'm using:
I trying to do custom filtration by subresource quantity. Problem what I encountered when I group resource it wrong display subresources (just 1 not all).
Result without any filtration:
"@id": "/api/formats/7",
"@type": "Format",
"title": "Cuda urody",
"categories": [],
"createdAt": "2021-12-02T12:53:18+01:00",
"updatedAt": "2021-12-02T12:53:18+01:00",
"seasons": [
{
"@id": "/api/seasons/7",
"@type": "Season",
"position": 0,
"seasonNumber": "1"
},
{
"@id": "/api/seasons/12",
"@type": "Season",
"position": 0,
"seasonNumber": "2"
}
]
...
Used filtration:
$alias = $queryBuilder->getRootAliases()[0];
$queryBuilder->groupBy($alias);
Result with filtration (missing subresource):
"@id": "/api/formats/7",
"@type": "Format",
"title": "Cuda urody",
"categories": [],
"createdAt": "2021-12-02T12:53:18+01:00",
"updatedAt": "2021-12-02T12:53:18+01:00",
"seasons": [
{
"@id": "/api/seasons/7",
"@type": "Season",
"position": 0,
"seasonNumber": "1"
}
]
...
Expectation: after using filter with grouping - get full subresources like in 1st example.
Yes I need use group in query to display filter results. Am I missing something or it's just api platform issue?
Probably problem is the way query is generated in api platform. I didn't notice problem when grouping Entity in Repository.
EDIT: I've managed to deal with this by adding on subresource (seasons)
fetch="EXTRA_LAZY"
so now it looks like
/**
* @ORM\OneToMany(targetEntity=Season::class, mappedBy="format", fetch="EXTRA_LAZY")
* @Groups({"format:read", "format:write"})
* @Assert\Valid
*/
#[ApiSubresource]
private $seasons;
I'm not sure if it is the proper way, but it works for me.
How to prevent a token created with OAuth 2.0 from expiring?
I am trying to give access to users in same specific datesFor example one of them started today and the comparison worked fine
I want to insert header and footer in my google docs with google docs api in PHP codeI am doing it like this-
I have an existing directory (php with xml datasource) which contains people information such as this: