What's the proper approach to using communication layer dependencies in console commands ? For busin
What's the proper approach to using communication layer dependencies in console commands ? For business layer i was following __construct
Comments
-
What would you like to achieve?
0 -
Normally we just call the facade
0 -
I'm using a facade from another module and i want to use a function from there, which calls to factory>object>method. I've added it to the dependency provider but i'm not quite sure how to call the other module facade
0 -
Inside the console execute()?
0 -
Yes
0 -
$this->getFacade()->registerCustomer($newCustomer);
0 -
Just use getFacade()
0 -
And it'll be auto wired.
0 -
That's going to catch both facades ?
0 -
getFacade() gets all of them
0 -
Okay, great, thanks
0 -
Hang on, I'm wrong.
0 -
I'll see what I can do
0 -
It attempts to access current module facade method and says it's undefined
0 -
i guess we both checked simultaneously ^_^
0 -
@U04RMV59JP8 sounds like a silly question but, why does one command rely on two facades?
0 -
Uses a function that was initially written in a different module but which does the exact same process that's needed in current module
0 -
Basically text parser was used in one module and then another module needed same processing and instead of duplicating the code I'm trying to use the same logic
0 -
Was talking about this earlier to a colleague, how about making a client layer and then using that?
0 -
So you share dependencies using a Zed request or something
0 -
I'll think about it, will ask colleagues and then decide
0 -
So, yeah, i made the mistake of forgetting that i've already solved this in business layer via factory method that returns the facade via DI
So i've just added the same thing to communication factory and got the facade that way. In case you were interested0 -
@U04RMV59JP8 believe it or not I did the same thing today xD
0 -
Thanks for your help too
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 69 Spryker News
- 896 Developer Corner
- 758 Spryker Development
- 83 Spryker Dev Environment
- 361 Spryker Releases
- 3 Oryx frontend framework
- 34 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 23 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 68 Spryker Safari Questions
- 50 Random