Forums / Extensions / SqliImport, search if attribute value already exists
Jérémie Caulier
Tuesday 03 May 2011 12:56:03 am
I have a content type that looks like this: myContentType { unique_id: integer title: string ...}
I retrieve data from an external data source and want to aggregate them automatically in eZ Publish content tree.
But before the import, I want to check if an other object related to "myContenType" not exists with the same unique_id value ...
What is the best way to proceed ?
Jérôme Vieilledent
Thursday 05 May 2011 6:16:45 am
Hi Jérémie
Actually, it's already implemented, native and automatic :).
If you use RemoteID, SQLIContent::create() will automatically check if a content already exists with this RemoteID. If this is the case, it will be returned. Then, when you'll publish it, the publisher will go through all the attributes and check if there has been a modification. If this is the case, a new version is created, if not the content is not modified.
You can check the doc in the "Simplified content API" part : http://svn.projects.ez.no/sqliimport/trunk/doc/README.txt
Saturday 07 May 2011 4:12:35 am
Thnx, it's a really nice extension !