Forums / Extensions / SqliImport, search if attribute value already exists

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

SqliImport, search if attribute value already exists

Author Message

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 Exponential 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

Jérémie Caulier

Saturday 07 May 2011 4:12:35 am

Thnx, it's a really nice extension !