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

excludeIf should work with @Content too #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marapper
Copy link
Contributor

ExcludeIf affects only on links. In some cases we need omit embedded relations too.
For example:

*@rest\Relation("http://hautelook.com/rels/invitations/reminders",

  • embed = @Rest\Content(property = ".childs"),
    
  • excludeIf = {".showChilds" = null}
    
  • )

@baldurrensch
Copy link
Contributor

Absolutely agreed. Was thinking that the other day!

/**
* {@inheritdoc}
*/
public function createExclude($object, $excludeIf)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The naming create* looks really weird for a method returning a boolean

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the using of factory. I know.

Unfortunately I don't find another proper endpoint (furthermore PropertyFactory have PropertyPath injection already). It would be wrong if MetadataFactory returns NULL when excludeIf conditions is true. And Metadata object is just set of setters/getters and don't contain logic. Visitor Design Pattern would be redundant here also.

So I need some advice.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marapper IMO, you need a new object for this instead of trying to fit it in an existing interface where it does not belong

@JJK801
Copy link
Contributor

JJK801 commented Mar 20, 2014

👍 for this PR to be merged

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

Successfully merging this pull request may close these issues.

4 participants