#17 Return the created/updated product ID from DataPump::ingest

Unstable_(example)
open
None
5
2013-12-03
2013-08-18
No

Hello,

I replaced an existing, slow import routine with Magmi using the DataPump API... fantastically fast! However, I needed to know the product ID after calling Ingest, so I could link to it from another DB table.

The reason is that I do a 2-step import using a 'staging table', to allow for better validation, batching and reliability. The staging table links to the product ID of the new product.

I believe this would be useful in other scenarios, and I think this simple patch is backwards compatible with existing usage.

1 Attachments

Related

Patches: #17

Discussion

  • John O'Rourke

    John O'Rourke - 2013-08-18

    Sample usage:

    $res = $dp->ingest( $item )
    if( $res[ "ok" ] === true )
    {
         $pid = $res[ "_product_id" ];
         ....
    } else
    {
         throw new Exception( "Magmi error: " . $res[ "_exception_message" ] );
    }
    
     
    Last edit: John O'Rourke 2013-08-18
  • Sebastien Bracquemont

    Hi, good idea indeed. i'll integrate this in next release , maybe with some enhancements (like embedding the full exception or other extra data (like stats))

     
  • John O'Rourke

    John O'Rourke - 2013-08-19

    Thanks Sebastien,

    I hope to contribute more as I start using magmi more.

    On 18 August 2013 23:36, Sebastien Bracquemont dweeves@users.sf.net wrote:

    Hi, good idea indeed. i'll integrate this in next release , maybe with
    some enhancements (like embedding the full exception or other extra data
    (like stats))


    Status: open
    Created: Sun Aug 18, 2013 07:22 PM UTC by John O'Rourke
    Last Updated: Sun Aug 18, 2013 07:24 PM UTC
    Owner: Sebastien Bracquemont

    Hello,

    I replaced an existing, slow import routine with Magmi using the DataPump
    API... fantastically fast! However, I needed to know the product ID after
    calling Ingest, so I could link to it from another DB table.

    The reason is that I do a 2-step import using a 'staging table', to allow
    for better validation, batching and reliability. The staging table links to
    the product ID of the new product.

    I believe this would be useful in other scenarios, and I think this simple
    patch is backwards compatible with existing usage.


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/magmi/patches/17/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

     

    Related

    Patches: #17


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks