-
Notifications
You must be signed in to change notification settings - Fork 145
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
CrudComponent::table() should support non-table model types #687
Comments
|
How should i use Endpoints from muffin/webservice with crud & crud-view then? |
There isn't any. Webservice plugin and Crud support for it will have to be re-thought for working without the deprecated features. If removing the return type for |
I think CrudComponent::table() should under the hood just call ProxyTrait::_table() of the current action class. |
Why do need to use |
Some of my controllers work with Tables and some with Endpoints if ($this->getModelType() === 'Table') {
$repository = $this->fetchTable();
} else {
$repository = $this->loadModel();
} It would nice to replace it with: $repository = $this->Crud->action()->_table();//protected - does not work or with something like $repository = $this->Crud->table(); To get same repository as current action uses. This would be more clean code without direct calling of any deprecated functions from my app |
Since you need to use 5.x is a different story. Will have to see how to update the Webservice plugin to work without the |
After last changes in cakephp 5.x all loadModel calls can be simply replaced with fetchModel calls |
Yes, would you like to submit a PR for the |
https://github.com/FriendsOfCake/crud/blob/master/src/Controller/Component/CrudComponent.php#L627-L638
Should be compatible with:
https://github.com/FriendsOfCake/crud/blob/master/src/Core/ProxyTrait.php#L128-L142
The text was updated successfully, but these errors were encountered: