RT 3.8.17 Documentation

Factory

Go to latest version →

$field

Returns the current value of $field. (In the database, $field is stored as $type.)

";

        unless ( exists $typemap{$field} && ( $typemap{$field} eq 'auto' || $typemap{$field} eq 'ro' )) {
            $FieldsPod .= "

Set$field VALUE

Set $field to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, $field will be stored as a $type.)

"; }

        $FieldsPod .= "

${field}Obj

Returns the $modulemap{$field} Object which has the id returned by $field

NAME

  $CollectionClassName -- Class Description
 

SYNOPSIS

  use $CollectionClassName

DESCRIPTION

METHODS

NewItem

Returns an empty new $RecordClassName item

NAME

$RecordClassName

SYNOPSIS

DESCRIPTION

METHODS

Create PARAMHASH

Create takes a hash of values and creates a row in the database:

$CreatePod

$Create

$FieldsPod

sub _CoreAccessible { {

$ClassAccessible } };

" . MagicImport($RecordClassName);

    print "About to make $RecordClassPath, $CollectionClassPath\n";
    `mkdir -p $path`;

    open( RECORD, '>', $RecordClassPath ) or die $!;
    print RECORD $RecordClass;
    close(RECORD);

    open( COL, '>', $CollectionClassPath ) or die $!;
    print COL $CollectionClass;
    close(COL);

}

sub MagicImport { my $class = shift;

    #if (exists \$warnings::{unimport})  {
    #        no warnings qw(redefine);

    my $path = $class;
    $path =~ s#::#/#gi;


    my $content = "
        eval \"require @{[$class]}_Overlay\";
        if (\$@ && \$@ !~ qr{^Can't locate ".$path."_Overlay.pm}) {
            die \$@;
        };

        eval \"require @{[$class]}_Vendor\";
        if (\$@ && \$@ !~ qr{^Can't locate ".$path."_Vendor.pm}) {
            die \$@;
        };

        eval \"require @{[$class]}_Local\";
        if (\$@ && \$@ !~ qr{^Can't locate ".$path."_Local.pm}) {
            die \$@;
        };

SEE ALSO

This class allows \"overlay\" methods to be placed into the following files _Overlay is for a System overlay by the original author, _Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.

These overlay files can contain new subs or subs to replace existing subs in this module.

Each of these files should begin with the line

   no warnings qw(redefine);

so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.

@{[$class]}_Overlay, @{[$class]}_Vendor, @{[$class]}_Local

← Back to index