original_string: protected function createTempCartOrder()
      {
          // Purge cart of the current user
          // It will be populated with the items from the cloning order
          $this->cart->delete(array('user_id' => $this->uid));
  
          $added = $count = 0;
  
          // Populate admin's cart
          foreach ($this->data_order['cart'] as $item) {
  
              $count++;
              unset($item['cart_id']);
              $item['user_id'] = $this->uid;
              $item['order_id'] = 0;
  
              if ($this->cart->add($item)) {
                  $added++;
              }
          }
  
          return $count && $count == $added;
      }
code: protected function createTempCartOrder()
      {
          // Purge cart of the current user
          // It will be populated with the items from the cloning order
          $this->cart->delete(array('user_id' => $this->uid));
  
          $added = $count = 0;
  
          // Populate admin's cart
          foreach ($this->data_order['cart'] as $item) {
  
              $count++;
              unset($item['cart_id']);
              $item['user_id'] = $this->uid;
              $item['order_id'] = 0;
  
              if ($this->cart->add($item)) {
                  $added++;
              }
          }
  
          return $count && $count == $added;
      }
code_tokens: protected function createTempCartOrder ( ) { // Purge cart of the current user // It will be populated with the items from the cloning order $ this -> cart -> delete ( array ( 'user_id' => $ this -> uid ) ) ; $ added = $ count = 0 ; // Populate admin's cart foreach ( $ this -> data_order [ 'cart' ] as $ item ) { $ count ++ ; unset ( $ item [ 'cart_id' ] ) ; $ item [ 'user_id' ] = $ this -> uid ; $ item [ 'order_id' ] = 0 ; if ( $ this -> cart -> add ( $ item ) ) { $ added ++ ; } } return $ count && $ count == $ added ; }
docstring: Creates temporary cart for the current admin
  @return bool
docstring_tokens: Creates temporary cart for the current admin