public static function category_options($categories, $includenotset = true, $includeinherit = true) {
        $options = self::base_options($includenotset, $includeinherit);
        foreach ($categories as $category) {
            $options[$category->get('id')] = $category->get('name');
        }

        return $options;
    }
public static function category_options($categories, $includenotset = true, $includeinherit = true) {
        $options = self::base_options($includenotset, $includeinherit);
        foreach ($categories as $category) {
            $options[$category->get('id')] = $category->get('name');
        }

        return $options;
    }
public static function category_options ( $ categories , $ includenotset = true , $ includeinherit = true ) { $ options = self :: base_options ( $ includenotset , $ includeinherit ) ; foreach ( $ categories as $ category ) { $ options [ $ category -> get ( 'id' ) ] = $ category -> get ( 'name' ) ; } return $ options ; }
From a list of category persistents to a list of id => name categories.

@param \tool_dataprivacy\category[] $categories
@param bool $includenotset
@param bool $includeinherit
@return string[]
From a list of category persistents to a list of id = > name categories .