Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotation for field that can't be filtered #178

Open
AlessandroMinoccheri opened this issue Oct 19, 2018 · 3 comments
Open

Annotation for field that can't be filtered #178

AlessandroMinoccheri opened this issue Oct 19, 2018 · 3 comments

Comments

@AlessandroMinoccheri
Copy link
Contributor

Q A
Bug report? no
Feature request? yes
QueryBundle version 2.4

Create an entity annotation on its fields to declare if that field can't be filtered so if a request try to filter with that field the query bundle remove automatically that filter for example the field password. Now that can be done into the request listener but I think is better to Do it into the entity

@sensorario
Copy link
Contributor

This is not a querybundle issue. I mean that data representation is made by JmsSerializer. Check you jms_serializer configuration. Here an example:

jms_serializer:
    metadata:
        directories:
            FooBar:
                namespace_prefix: "Foo\\BarBundle"
                path: "%kernel.root_dir%/serializer/FooBar"
    default_context:
        serialization:
            serialize_null: true

Inside folder ./app/serializer/FooBar/Model.User.yml you whould have the following file content:

Foo\BarBundle\Model\User:
    exclusion_policy: ALL
    properties:
        id:
            expose: true
        username:
            expose: true
        name:
            expose: true
        email:
            expose: true
        enabled:
            expose: true
        divisions:
            expose: true
        additional_filters:
            expose: true

@AlessandroMinoccheri
Copy link
Contributor Author

Filter is different than expose, I want to be sure that a field can't be passed to query bundle, for example field mobile phone can't be added into query string with filtering but can be exposed.

@sensorario
Copy link
Contributor

👍 ok now I got it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants