public function toObject()
  {
    $groups = $this->groups;
    foreach($groups as &$group){
      $group = $group->toObject();
    }
    
    $items = $this->items;
    foreach($items as &$item){
      $item = $item->toObject();
    }
    
    return (object)[
      'type'   => $this->type, 
      'value'  => $this->value, 
      'text'   => $this->text, 
      'groups' => $groups,
      'items'  => $items,
    ];
  }