Tuesday, 15 March 2011

csv - CsvBulkLoader import/update only existing objects -


I am using a simple CSV loader in the bulk update data tab.

  Class OrderImporter extends CsvBulkLoader {public $ delimiter = ';'; Public $ enclosure = '' ', header $ true; Public $ column I = array ('id' = & gt; 'id', 'seedlight' = & gt; 'pad', 'gyandert' = & gt; 'requirement review');}  

My problem is, I do not want to create new things, if they are in the import file, I only want to update existing ones.

Is there a way to achieve this? Sadly, I can not find anything in the docs.

I think you can take a look at CsvBulkLoader :: processRecord () Put on. This is where each line is processed. You can try in your order ammeter class (untested):

  protected function process record ($ record, $ columnmap, & amp; $ result, $ preview = false) {// current Object $ current objections = $ this- & gt; Find Axing Object ($ record, $ columnmap); Return ($ Existing Object)? Parents :: Procedure ($ record, $ columnmap, $ result, $ preview): Wrong; }  

hh, wmk


No comments:

Post a Comment