-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
A more helpful way of creating EAV attributes #4266
Comments
Nice idea! $attributeConfig = $this->productAttributeConfigurationFactory
->create()
->unique()
->usedInGrid()
->useFrontendInputText()
->withStoreScope()
.... The product types, backend types and additional options are too generic, but the value scopes and the input types are pretty fixed. There still could be a generic method if something different is needed, too. |
Sure, why not. We should make this as friendly as possible. Still, I'm thinking that the input types are too many to make each of them a separate method, however much I would like that. |
It would be so easy to see input types are available, I think it would be perfect - self-documenting code :) |
I agree, but I still think they're too many methods. This increases the chances of the interface changing whenever you add a new input. Not very likely, but, when it does happen, it'll break the contract. Unless I ditch the interfaces and just use a concrete class, which I'm starting to think it's a good idea. Also, isn't that the same case with backend types? Aka a standard set which can be added as methods. |
Closing in favor of the referenced PR |
[MPI] Braintree SDK V3.0
Hi. Me again.
I was wondering if this would be ok for a future PR: https://github.com/adragus-inviqa/m2-eav-attribute-configurator.
It would finally provide us with some OOP sweetness in an important part of our day-to-day work: adding EAV attributes. I can't tell how many times I've got those wrong. It's about time the IDE would help with that.
The addition is BC-friendly and can be used with the old code as well. But, for an even more future-proof code, I'd rather get rid of the interfaces, so additional methods can be added without breaking some contract. That is, if those configurations are to be changed at some point, which I think they probably will.
The text was updated successfully, but these errors were encountered: