Example #1
0
 public function doLoadQueque()
 {
     $params = json_decode(Session::getActiveMigrationData(), true);
     $this->url = $params['apiurl'];
     $this->key = $params['apikey'];
     switch ($params['entity']) {
         case 1:
             $request = $this->getProductIds();
             $this->registry->cache->save('migration_products', $request['ids']);
             break;
         case 2:
             $request = $this->getCategoryIds();
             $this->registry->cache->save('migration_categories', $request['ids']);
             break;
         case 3:
             $request = $this->getProducerIds();
             $this->registry->cache->save('migration_producers', $request['ids']);
             break;
         case 4:
             $request = $this->getPhotosTotal();
             $this->registry->cache->save('migration_photos', $request['ids']);
             break;
         case 5:
             $name = 'Migration Group' . mt_rand(1, 10000);
             $groupId = App::getModel('attributegroup')->addEmptyGroup(array('name' => $name));
             Session::setActiveMigrationGroupName($name);
             Session::setActiveMigrationGroupId($groupId['id']);
             $request = $this->getAttributesIds();
             $this->registry->cache->save('migration_attributes', $request['ids']);
             break;
         case 6:
             $request = $this->getOrderIds();
             $this->registry->cache->save('migration_orders', $request['ids']);
             break;
         case 7:
             $request = $this->getSimilarProductsIds();
             $this->registry->cache->save('migration_similarproducts', $request['ids']);
             break;
     }
     return array('iTotal' => count($request['ids']), 'iCompleted' => 0);
 }