original_string: public function getQuantity(array $options, $type = null)
      {
          $options += array('order_id' => 0);
  
          $result = array(
              'total' => 0,
              'sku' => array()
          );
  
          foreach ((array) $this->getList($options) as $item) {
              $result['total'] += (int) $item['quantity'];
              $result['sku'][$item['sku']] = (int) $item['quantity'];
          }
  
          if (isset($type)) {
              return $result[$type];
          }
  
          return $result;
      }
code: public function getQuantity(array $options, $type = null)
      {
          $options += array('order_id' => 0);
  
          $result = array(
              'total' => 0,
              'sku' => array()
          );
  
          foreach ((array) $this->getList($options) as $item) {
              $result['total'] += (int) $item['quantity'];
              $result['sku'][$item['sku']] = (int) $item['quantity'];
          }
  
          if (isset($type)) {
              return $result[$type];
          }
  
          return $result;
      }
code_tokens: public function getQuantity ( array $ options , $ type = null ) { $ options += array ( 'order_id' => 0 ) ; $ result = array ( 'total' => 0 , 'sku' => array ( ) ) ; foreach ( ( array ) $ this -> getList ( $ options ) as $ item ) { $ result [ 'total' ] += ( int ) $ item [ 'quantity' ] ; $ result [ 'sku' ] [ $ item [ 'sku' ] ] = ( int ) $ item [ 'quantity' ] ; } if ( isset ( $ type ) ) { return $ result [ $ type ] ; } return $ result ; }
docstring: Returns cart quantity
  @param array $options
  @param string $type
  @return array|integer
docstring_tokens: Returns cart quantity