Import
Whenever interaction with other systems is required, data objects are the vital components of data exchange. Pimcore data objects can be created and filled programmatically in order to realize batch imports. The following example indicates the creation of a new object of the class "myclass"
$object = new Object_Myclass(); $object->setCreationDate(time()); $object->setUserOwner($user->getId()); $object->setUserModification($user->getId()); $object->setPublished(true); $object->setMyattribute("This is a test"); $object->setKey(1); $object->setParentId(1); $object->save();
Thus, with very few lines of codes importer scripts can be implemented to populate data objects. Please have a look at our example importer script in Best Practices - Object Import.
Export
Export of data objects can be achieved programmatically or through pimcore CSV export. The UI export can be found when clicking on an object folder and selecting the Search, Edit & Export Tab.
Memory Issues
| Note If you're using / creating very much objects you should call the pimcore garbage collector after every cycle to prevent memory issues! // just call this static method (available since 1.3.3) WARNING: This will flush the entire Zend_Registry! To avoid this, you can pass an array with keys (indexes) which should stay in the registry eg. Pimcore::collectGarbage(array("myImportantKey","myConfig")); |