docs icon indicating copy to clipboard operation
docs copied to clipboard

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

Open matks opened this issue 5 years ago • 2 comments

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:

  • twig emplate override (maybe only 1 block to demonstrate the twig block override usage)
  • Query and QueryHandler extension mechanisms using SF service override and decorator pattern

matks avatar May 27 '19 09:05 matks

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)

zuk3975 avatar May 19 '21 11:05 zuk3975

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.

matks avatar May 19 '21 11:05 matks