--- /dev/null
+<?php
+
+class SugarProduct extends SugarObject {
+
+ public function getModuleName(){
+ return "maint_catalogue_produits";
+ }
+
+ public function getFieldsToRetrieve(){
+ return array(
+ 'id',
+ 'name',
+ );
+ }
+
+ public function synchronize(){
+ $sugar_product_list = $this->listObject();
+ $pdoProductManager = new PdoProductManager();
+
+ foreach($sugar_product_list as $sugar_id => $sugar_product_info){
+ $product = $pdoProductManager->getBySugarId($sugar_id);
+ if (! $product){
+ $product = new Product();
+ }
+ $product->sugar_id = $sugar_id;
+ $product->name = $sugar_product_info['name'];
+ $pdoProductManager->editProduct($product);
+ }
+ return true;
+ }
+}
\ No newline at end of file