original_string: public function getContent(array $data)
      {
          $result = &gplcart_static(gplcart_array_hash(array('cart.get.content' => $data)));
  
          if (isset($result)) {
              return $result;
          }
  
          $this->hook->attach('cart.get.content.before', $data, $result, $this);
  
          if (isset($result)) {
              return $result;
          }
  
          $data['order_id'] = 0;
  
          $items = $this->getList($data);
  
          if (empty($items)) {
              return array();
          }
  
          $result = array(
              'store_id' => $data['store_id'],
              'currency' => $this->currency->getCode()
          );
  
          $total = $quantity = 0;
  
          foreach ((array) $items as $item) {
              $prepared = $this->prepareItem($item, $result);
              if (!empty($prepared)) {
                  $result['items'][$item['sku']] = $prepared;
                  $total += (int) $prepared['total'];
                  $quantity += (int) $prepared['quantity'];
              }
          }
  
          $result['total'] = $total;
          $result['quantity'] = $quantity;
  
          $this->hook->attach('cart.get.content.after', $data, $result, $this);
          return $result;
      }
code: public function getContent(array $data)
      {
          $result = &gplcart_static(gplcart_array_hash(array('cart.get.content' => $data)));
  
          if (isset($result)) {
              return $result;
          }
  
          $this->hook->attach('cart.get.content.before', $data, $result, $this);
  
          if (isset($result)) {
              return $result;
          }
  
          $data['order_id'] = 0;
  
          $items = $this->getList($data);
  
          if (empty($items)) {
              return array();
          }
  
          $result = array(
              'store_id' => $data['store_id'],
              'currency' => $this->currency->getCode()
          );
  
          $total = $quantity = 0;
  
          foreach ((array) $items as $item) {
              $prepared = $this->prepareItem($item, $result);
              if (!empty($prepared)) {
                  $result['items'][$item['sku']] = $prepared;
                  $total += (int) $prepared['total'];
                  $quantity += (int) $prepared['quantity'];
              }
          }
  
          $result['total'] = $total;
          $result['quantity'] = $quantity;
  
          $this->hook->attach('cart.get.content.after', $data, $result, $this);
          return $result;
      }
code_tokens: public function getContent ( array $ data ) { $ result = & gplcart_static ( gplcart_array_hash ( array ( 'cart.get.content' => $ data ) ) ) ; if ( isset ( $ result ) ) { return $ result ; } $ this -> hook -> attach ( 'cart.get.content.before' , $ data , $ result , $ this ) ; if ( isset ( $ result ) ) { return $ result ; } $ data [ 'order_id' ] = 0 ; $ items = $ this -> getList ( $ data ) ; if ( empty ( $ items ) ) { return array ( ) ; } $ result = array ( 'store_id' => $ data [ 'store_id' ] , 'currency' => $ this -> currency -> getCode ( ) ) ; $ total = $ quantity = 0 ; foreach ( ( array ) $ items as $ item ) { $ prepared = $ this -> prepareItem ( $ item , $ result ) ; if ( ! empty ( $ prepared ) ) { $ result [ 'items' ] [ $ item [ 'sku' ] ] = $ prepared ; $ total += ( int ) $ prepared [ 'total' ] ; $ quantity += ( int ) $ prepared [ 'quantity' ] ; } } $ result [ 'total' ] = $ total ; $ result [ 'quantity' ] = $ quantity ; $ this -> hook -> attach ( 'cart.get.content.after' , $ data , $ result , $ this ) ; return $ result ; }
docstring: Returns a cart content
  @param array $data
  @return array
docstring_tokens: Returns a cart content