A place to put the business logic #12
-
Not sure if this is an issue, but as far as I can see only classes which extend Extbase's As example, lets say I need to have an endpoint which receives a complex setting-object. The settings are stored in multiple tables, so usually a controller or service has do handle this. Another usecase is how to make aggregated/calculated database values available? Like a statistic-endpoint which gives back aggregated values based on a custom SQL query using SUM/AVG functions (logic from a repository). I took a look to the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Support for custom endpoints with own controller is already done in branch https://github.com/sourcebroker/t3api/tree/issue-7 but needs to be yet rechecked before merging to master. In short you need to register handler in ext_localconf.php
The Then create a model for business logic (in this model you will define possible endpoints with annotations)
And then implement handler itself like in this example:
|
Beta Was this translation helpful? Give feedback.
-
That's amazing! It was quite difficult to understand whats going on with this new OperationHandler feature and how to deal with it, but so far it's working great I would say. At least I didn't run into any issue, so from my side this can be merged. Some documentation for the release would be appreciated for sure ;-) But I've to say that this feature seems adding a lot of code, and I don't have any overview what is new, what has changed to the current version or how to test all the new functions. So, no guaranties. Edit 1: Maybe there is a problem, but not sure. I tried to use a custom repository, which extends the
The code:
Edit 2: I tried the solution to check against an interface (
With these changes, we could make the above code example for
|
Beta Was this translation helpful? Give feedback.
Support for custom endpoints with own controller is already done in branch https://github.com/sourcebroker/t3api/tree/issue-7 but needs to be yet rechecked before merging to master.
In short you need to register handler in ext_localconf.php
The
100
is priority if there is more implementation of the same endpoint.Then create a model for business logic (in this model you will define possible endpoints with annotations)
(
Classes/Domain/Mo…