public function get_categories_with_fields() : array {
        if ($this->categories === null) {
            $this->categories = api::get_categories_with_fields($this->get_component(), $this->get_area(), $this->get_itemid());
        }
        $handler = $this;
        array_walk($this->categories, function(category_controller $c) use ($handler) {
            $c->set_handler($handler);
        });
        return $this->categories;
    }