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;
    }
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;
    }
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 ; }
Returns array of categories, each of them contains a list of fields definitions.

@return category_controller[]
Returns array of categories each of them contains a list of fields definitions .