-
Notifications
You must be signed in to change notification settings - Fork 113
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
hidden/visible properties on relation #58
Comments
👍 this is one that we should add for sure. |
evan108108
pushed a commit
that referenced
this issue
Oct 25, 2013
evan108108
added a commit
that referenced
this issue
Oct 25, 2013
Issue #58: hidden/visible properties on relation
@blitzjs I have updated RESTFullYii and now you can do things like this: $this->onRest('model.hidden.properties', function() {
return ['password', 'id', '*.title', 'posts.id', '*.website'];
});
$this->onRest('model.visible.properties', function() {
return ['username', 'email', 'posts.id', '*.title', 'profile.website'];
}); The '*" is a wildcard that will act on all relations. I hope this helps and thanks again for the suggestion! |
Thanks for addressing this so quickly! |
@evan108108 is it possible to hide overrided model's attribute. for example,
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently hidden/visible properties only apply to the current model, but when displaying a model with relations, it would be nice to be able to limit what the relation shows, i.e.
model = Address
{
"city": "Los Angeles",
...
}
Just like the other request allowing filtering on relations, we could use a dot to specify a hidden/visible relation property, i.e.
The text was updated successfully, but these errors were encountered: