original_string: public function getList($prodict_id)
      {
          $result = null;
          $this->hook->attach('product.field.list.before', $prodict_id, $result, $this);
  
          if (isset($result)) {
              return $result;
          }
  
          $sql = 'SELECT * FROM product_field WHERE product_id=?';
          $fields = $this->db->fetchAll($sql, array($prodict_id));
  
          $result = array();
          foreach ($fields as $field) {
              $result[$field['type']][$field['field_id']][] = $field['field_value_id'];
          }
  
          $this->hook->attach('product.field.list.after', $prodict_id, $result, $this);
          return $result;
      }
code: public function getList($prodict_id)
      {
          $result = null;
          $this->hook->attach('product.field.list.before', $prodict_id, $result, $this);
  
          if (isset($result)) {
              return $result;
          }
  
          $sql = 'SELECT * FROM product_field WHERE product_id=?';
          $fields = $this->db->fetchAll($sql, array($prodict_id));
  
          $result = array();
          foreach ($fields as $field) {
              $result[$field['type']][$field['field_id']][] = $field['field_value_id'];
          }
  
          $this->hook->attach('product.field.list.after', $prodict_id, $result, $this);
          return $result;
      }
code_tokens: public function getList ( $ prodict_id ) { $ result = null ; $ this -> hook -> attach ( 'product.field.list.before' , $ prodict_id , $ result , $ this ) ; if ( isset ( $ result ) ) { return $ result ; } $ sql = 'SELECT * FROM product_field WHERE product_id=?' ; $ fields = $ this -> db -> fetchAll ( $ sql , array ( $ prodict_id ) ) ; $ result = array ( ) ; foreach ( $ fields as $ field ) { $ result [ $ field [ 'type' ] ] [ $ field [ 'field_id' ] ] [ ] = $ field [ 'field_value_id' ] ; } $ this -> hook -> attach ( 'product.field.list.after' , $ prodict_id , $ result , $ this ) ; return $ result ; }
docstring: Returns an array of fields for a given product
  @param integer $prodict_id
  @return array
docstring_tokens: Returns an array of fields for a given product