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

Exclude field for depth #1022

Closed
1271 opened this issue Dec 16, 2018 · 2 comments
Closed

Exclude field for depth #1022

1271 opened this issue Dec 16, 2018 · 2 comments

Comments

@1271
Copy link

1271 commented Dec 16, 2018

Q A
Bug report? no
Feature request? no
BC Break report? no
RFC? no

Hey.
How can I exclude a field with a depth greater than 1?

For example:

Entity/Article:

[
'article' => [
   'id' => 1,
       'title' => 'L',
       'text' => 'text - here',
   ],
   ...
]

But for user relation we need:

[
   'user' => [
      ...
      'articles' => [
      [
        'id' => 1,
      ],
      [
        'id' => 2,
      ],
    ],
]

Is there such a possibility?

Thank you!

@goetas
Copy link
Collaborator

goetas commented Dec 16, 2018 via email

@1271
Copy link
Author

1271 commented Dec 16, 2018

Thank! This solved the problem.

Solve example:

 * @Expose(if="context.getDepth() < 2")

@1271 1271 closed this as completed Dec 16, 2018
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