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

Feature request: Split the Repository into traits #91

Closed
tomasvanrijsse opened this issue Apr 30, 2021 · 1 comment
Closed

Feature request: Split the Repository into traits #91

tomasvanrijsse opened this issue Apr 30, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@tomasvanrijsse
Copy link

Detailed description

Our repositories don't always include all the CRUD actions.
e.g. we have read-only resources that only include the GET index and GET singular resource endpoints.
If I'd extend Swis\JsonApi\Client\Repository our repositories would have methods that call non-existing endpoints.
To prevent this I have created custom repositories that basically have a selection of the Swis\JsonApi\Client\Repository methods.

Possible implementation

The Swis\JsonApi\Client\Repository class consists of all the CRUD methods.
If these methods would be moved to traits and the Repository would use those, the class would work the same.
It would also enable custom repositories with just a few of these traits, without having to rewrite them.
We could then make repositories ourselves using your traits like hasIndexAction and hasDeleteAction.

@JaZo
Copy link
Member

JaZo commented Apr 30, 2021

Sounds good, we're open to pull requests!

@JaZo JaZo added the enhancement New feature or request label Apr 30, 2021
@JaZo JaZo closed this as completed in 3db172a Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants