public static function get_purpose_options($includeinherit, $includenotset) {
        $warnings = [];

        $params = self::validate_parameters(self::get_category_options_parameters(), [
            'includeinherit' => $includeinherit,
            'includenotset' => $includenotset
        ]);
        $includeinherit = $params['includeinherit'];
        $includenotset = $params['includenotset'];

        $context = context_system::instance();
        self::validate_context($context);

        $purposes = api::get_purposes();
        $options = data_registry_page::purpose_options($purposes, $includenotset, $includeinherit);
        $purposeoptions = [];
        foreach ($options as $id => $name) {
            $purposeoptions[] = [
                'id' => $id,
                'name' => $name,
            ];
        }

        return [
            'options' => $purposeoptions,
            'warnings' => $warnings
        ];
    }
public static function get_purpose_options($includeinherit, $includenotset) {
        $warnings = [];

        $params = self::validate_parameters(self::get_category_options_parameters(), [
            'includeinherit' => $includeinherit,
            'includenotset' => $includenotset
        ]);
        $includeinherit = $params['includeinherit'];
        $includenotset = $params['includenotset'];

        $context = context_system::instance();
        self::validate_context($context);

        $purposes = api::get_purposes();
        $options = data_registry_page::purpose_options($purposes, $includenotset, $includeinherit);
        $purposeoptions = [];
        foreach ($options as $id => $name) {
            $purposeoptions[] = [
                'id' => $id,
                'name' => $name,
            ];
        }

        return [
            'options' => $purposeoptions,
            'warnings' => $warnings
        ];
    }
public static function get_purpose_options ( $ includeinherit , $ includenotset ) { $ warnings = [ ] ; $ params = self :: validate_parameters ( self :: get_category_options_parameters ( ) , [ 'includeinherit' => $ includeinherit , 'includenotset' => $ includenotset ] ) ; $ includeinherit = $ params [ 'includeinherit' ] ; $ includenotset = $ params [ 'includenotset' ] ; $ context = context_system :: instance ( ) ; self :: validate_context ( $ context ) ; $ purposes = api :: get_purposes ( ) ; $ options = data_registry_page :: purpose_options ( $ purposes , $ includenotset , $ includeinherit ) ; $ purposeoptions = [ ] ; foreach ( $ options as $ id => $ name ) { $ purposeoptions [ ] = [ 'id' => $ id , 'name' => $ name , ] ; } return [ 'options' => $ purposeoptions , 'warnings' => $ warnings ] ; }
Fetches a list of data storage purposes containing purpose IDs as keys and the purpose name for the value.

@param bool $includeinherit Whether to include the "Inherit" option.
@param bool $includenotset Whether to include the "Not set" option.
@return array
Fetches a list of data storage purposes containing purpose IDs as keys and the purpose name for the value .