public static function delete_category(category_controller $category) : bool {
        $event = category_deleted::create_from_object($category);

        // Delete all fields.
        foreach ($category->get_fields() as $field) {
            self::delete_field_configuration($field);
        }

        $result = $category->delete();
        $event->trigger();
        return $result;
    }
public static function delete_category(category_controller $category) : bool {
        $event = category_deleted::create_from_object($category);

        // Delete all fields.
        foreach ($category->get_fields() as $field) {
            self::delete_field_configuration($field);
        }

        $result = $category->delete();
        $event->trigger();
        return $result;
    }
public static function delete_category ( category_controller $ category ) : bool { $ event = category_deleted :: create_from_object ( $ category ) ; // Delete all fields. foreach ( $ category -> get_fields ( ) as $ field ) { self :: delete_field_configuration ( $ field ) ; } $ result = $ category -> delete ( ) ; $ event -> trigger ( ) ; return $ result ; }
Delete a custom field category

@param category_controller $category
@return bool
Delete a custom field category