<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */


class JsObjectToArray
{
  protected $array;

  
  public function __construct($str)
  {
    $str = str_replace('[DBQUOTE]', '"', $str);
    $this->array = json_decode(StringOperations::utf8_encode($str), true);

    
    $tmp = array();
    foreach ($this->array as $value) {
      foreach ($value as $val) {
        if ($val['type'] != 'space') {
          $tmp[] = $val;
        }
      }
    }

    $this->array = $tmp;
  }

  public function ToArray()
  {
    return $this->array;
  }
}