PrestaShop / docs

PrestaShop technical documentation
https://devdocs.prestashop-project.org/
Other
120 stars 477 forks source link

Demonstrate how to extend a Query+QueryHandler for "View Brand" page #276

Open matks opened 5 years ago

matks commented 5 years ago

Page "Suppliers > Brands" has been migrated, including "View a Brand" BO page available at URL /admin-dev/index.php/sell/catalog/brands/{brandId}/view

We should demonstrate how someone can customize this view, using:

zuk3975 commented 3 years ago

So you mean to override EVERYTHING - the command, the handler, the query result? :smile: btw Im not sure does overrides work with ANY classes (including the ones in domain) as well?

We are using the HandlerInterface everywhere in core, that means with service definition we can only re-map the handler/command if it respects the interface types (which doesn't feel very usefull for me)

matks commented 3 years ago

btw Im not sure does overrides work with ANY classes (including the ones in domain) as well?

I mean services override 😉 . When you declare a YAML config file in the module and you reuse a service name.

We are using the HandlerInterface everywhere in core, that means with service definition we can only re-map the handler/command if it respects the interface types (which doesn't feel very useful for me)

Indeed if we use new php classes, they will have to implement existing interfaces or extend existing classes.

the command, the handler, the query result

The Command can be overridden if we need to pass more data, for a module usecase. For example add a my_module_field_id to a Command.