Skip to content
This repository has been archived by the owner on Aug 3, 2018. It is now read-only.

ProductListViewFactory cannot be extended #84

Open
11mb opened this issue Dec 15, 2017 · 4 comments
Open

ProductListViewFactory cannot be extended #84

11mb opened this issue Dec 15, 2017 · 4 comments
Assignees

Comments

@11mb
Copy link

11mb commented Dec 15, 2017

Should the ProductListViewFactory be a final class? Now it is very hard to change the creation of e.g. a variantView.

I want to pass the options from VariantDocument:getOptions() to the VariantView via the ProductListViewFactory. But because this class is final, and the getVarantViews method is private I have to duplicate the whole class.

@pamil
Copy link

pamil commented Dec 18, 2017

It is meant to be final, even though we should extract more view factories, like ProductViewFactory, ProductVariantViewFactory, so that the interfaces would be more segregated and most of the extensions can be done by composition (just like with the document factories).

@pamil
Copy link

pamil commented Mar 1, 2018

Don't know why but I can't assign you @psihius so I'm writing this comment 🎉

@psihius
Copy link

psihius commented Mar 1, 2018

Probably because i'm not a member of the organization/repository @pamil :)

@psihius psihius self-assigned this Mar 8, 2018
@samvdb
Copy link

samvdb commented May 31, 2018

@11mb, Not sure if this can help you, but if you use symfony's service decoration you can inject the ProductListViewFactory into your new service, then simply call the createFromSearchResponse() on the inner service and perform your extra logic on the ProductListView object that is returned.

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

No branches or pull requests

4 participants