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

refactor: move setFilter to Resource class #51

Open
Regaez opened this issue Aug 21, 2019 · 0 comments
Open

refactor: move setFilter to Resource class #51

Regaez opened this issue Aug 21, 2019 · 0 comments

Comments

@Regaez
Copy link
Owner

Regaez commented Aug 21, 2019

Perhaps the setFilter function could be moved into the abstract Resource class and made to be generic, so it's not repeatedly defined in all the different resource types, e.g.

protected function setFilter()
{
    $filter = Config::instance()->{$this->getResourceType()}->get->fields;
    
    if (!empty($filter)) {
        $this->filter = $filter;
    }
}

Then would need to adjust mapping so that getResourceType() returns the correct value for the config... currently would return user not users etc

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

No branches or pull requests

1 participant