Advertisement
Guest User

Untitled

a guest
Sep 30th, 2014
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.17 KB | None | 0 0
  1. protected function _insertQueueElements($container)
  2.     {
  3.         $bootstrap = $this->getInvokeArg('bootstrap');
  4.         $env = $bootstrap->getEnv();
  5.         $connection = 'sql/stock';
  6.         Environment::getInstance()->processConnections($connection);
  7.         SQL::init(
  8.             NestedArrayHelper::findNestedKey($connection, 'host'),
  9.             NestedArrayHelper::findNestedKey($connection, 'username'),
  10.             NestedArrayHelper::findNestedKey($connection, 'password'),
  11.             NestedArrayHelper::findNestedKey($connection, 'dbname'),
  12.             get_class($this).'stocks'
  13.         );
  14.         SQL::selectConnection(get_class($this).'stocks');
  15.         $xmlDocument = simplexml_load_string($container);
  16.  
  17.         $stockStorage = new SqlStockStorage(get_class($this).'stocks', 'order');
  18.         foreach ($xmlDocument->StatusTrigger->OrderLines->OrderLine as $ItemLine) {
  19.             $data['product_id'] = $ItemLine->ItemNumber;
  20.             $data['color_id'] = $ItemLine->colorAXDimensionId;
  21.             $data['size_id'] = $ItemLine->size;
  22.  
  23.             $stockStorage->setData($data);
  24.             $stockStorage->saveOrder();
  25.             unset($data);
  26.         }
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement