private function _getEncryptedJson(LivePos_Maps_Customer $customer, LivePos_Maps_Order $order)
 {
     $aToEncrypt = array('order' => $order->getPublicVars(), 'customer' => $customer->getPublicVars());
     //return(  json_encode( $aToEncrypt ) );
     return Netsuite_Crypt::encrypt(json_encode($aToEncrypt));
 }
 /**
  * Sends Stackable Thread to Thread Pool for Processing.
  *
  * @return void
  * @access public
  */
 public function poolOrders()
 {
     foreach ($this->_orders as $aOrder) {
         $aOrderData = current(json_decode($aOrder['receipt_string'], true));
         $sOrderId = $this->_getOrderId($aOrderData);
         $iInvoiceId = $this->_getInvoiceId($aOrderData);
         $aLocation = $this->_getLocation($aOrder['location_id'], $sOrderId);
         $sOrderToMerge = null;
         if (isset($this->_webOrders[$iInvoiceId])) {
             $sOrderToMerge = Netsuite_Crypt::decrypt($this->_webOrders[$iInvoiceId]['order_data'], true);
             $this->_webOrdersMerged[] = $this->_webOrders[$iInvoiceId]['queue_id'];
         }
         $aWork[] = $tThread = $this->_pool->submit(new LivePos_LivePosOrder($sOrderId, $aOrder, $aLocation, $sOrderToMerge));
     }
     $this->_pool->shutdown();
     $this->_model->updateToMerged($this->_webOrdersMerged);
     $this->_queueOrders();
     foreach ($this->_pool->workers as $worker) {
         $this->_logTestResults($worker->getData());
     }
     if (DEBUG) {
         foreach ($this->_pool->workers as $worker) {
             print_r($worker->getData());
         }
     }
 }