'How to filter DiscrimnatorMaps with Api Platform?
Using Api Platform 2.6, and SF 4.4, I would like to use an Entity as a Discriminator and filter it.
I have 3 Entities: Resource, Collaborator and Material
Resource is the super mapped class, and defined like this:
/**
* @ApiResource
* @ApiFilter(SearchFilter::class, properties={
* "company": "exact",
* "collaborator.lastname":"partial",
* "lastname": "partial",
* "title": "partial",
* "material.title":"partial"
* })
* @Entity
* @InheritanceType("SINGLE_TABLE")
* @DiscriminatorColumn(name="discr", type="string")
* @DiscriminatorMap({"resource"="Resource", "collaborator"="Collaborator", "material"="Material"})
*/
class Resource
{
I want to allow to filter all resources (Collaborator and Material) by some of their properties (for example title belongs to Material, and lastname belongs to Collaborator).
For now, these filters don't appear in the Api Doc, is it possible at least ? I can't find many informations on Git / Doc.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
