RT 5.0.3 Documentation

RT::CustomFieldValues::Canonicalizer

Go to latest version →

NAME

RT::CustomFieldValues::Canonicalizer - base class for custom field value canonicalizers

SYNOPSIS

DESCRIPTION

This class is the base class for custom field value canonicalizers. To implement a new canonicalizer, you must create a new class that subclasses this class. Your subclass must implement the method "CanonicalizeValue" as documented below. You should also implement the method "Description" which is the label shown to users. Finally, add the new class name to "@CustomFieldValuesCanonicalizers" in RT_Config.

See RT::CustomFieldValues::Canonicalizer::Uppercase for a complete example.

new

The object constructor takes one argument: RT::CurrentUser object.

CanonicalizeValue

Receives a parameter hash including CustomField (an RT::CustomField object) and Content (a string of user-provided content).

You may also access $self->CurrentUser in case you need the user's language or locale.

This method is expected to return the canonicalized Content.

Description

A class method that returns the human-friendly name for this canonicalizer which appears in the admin UI. By default it is the class name, which is not so human friendly. You should override this in your subclass.

← Back to index