What are the Slack Archives?
Itβs a history of our time together in the Slack Community! Thereβs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonβt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hey when you extend a DB table do you also need to extend the dataImport module that writes initial
Hey when you extend a DB table do you also need to extend the dataImport module that writes initial data? i.e. if I extended the spy_stock table with a field called description
=> console data:import:stock
then I would need to update the writer step or something?
Comments
-
maybe in Orm/Zed ?
0 -
or maybe I need to extend StockDataImport ?
0 -
If your new db field is a required one, then yes.
0 -
hm... so if I extend the interface can I just add some new columns? the dataset looks like it's mapping from the interface
0 -
on project level it would be like StockDataImport/InsaneNumberOfDirectories/StockDataImportInterface.php and then drop a few new const COLUMNS_FIELD_NAME in there... or do I also need to extend the writer itself?
0 -
Ah, now I'm getting it.
In some cases, importing a new column might work out of the box, if your column name in csv matches the db column name and the importer is using fromArray and toArray stuff. You can just try it out, in worst case it will ignore your additional column, but doesn't break the import.In general, I'd recommend to check what hydrator (if any) and writer steps the specific importer is using. Most likely, you'll need some very simple adjustments there.
What import are you going to extend? Is it an existing one from the demoshop?
0 -
Yeh... extending
data:import:stock
if I'm understanding correctly the hydrator step may need some minor tweaking.I'll but together a shareable example Monday might be more informative than talking in the abstract.
0 -
Hey @U01LKKBK97T so maybe I don't understand how to extend the writer step, maybe it needs a plugin? I didn't see a hydrator. Seems like updating the writing step would do it, but no dice... https://github.com/ed42311/spryker-antelope/pull/1 created the PR for a clean diff
0 -
No... you can just extend the writer, but you also need to extend/override the business factory to ensure your class is instatiated instead of the Spryker one
0 -
Do you need to register you project classes in the project level factory? https://github.com/ed42311/spryker-antelope/pull/1/files
0 -
seems like there are a couple different ways to do this: https://documentation.spryker.com/docs/core-extension#extension-via-object-composition
0 -
Ok I got the process to see my class anyway...
0 -
Alright got it to work. next question what DB field saves both upper and lowercase letters?
0 -
maybe I didn't run propel and transfer
0 -
yup forgot to take unique off the table, so anyone have any thoughts about this composition versus direct extension?
0 -
Alright got it thanks for pointing me in the right direction @U01LKKBK97T @U01A5ARAXP0
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 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
- 70 Spryker Safari Questions
- 50 Random