Freeside:1.9:Documentation:Developer/FS/part export

From Freeside
Jump to: navigation, search

NAME

FS::part_export - Object methods for part_export records

SYNOPSIS

 use FS::part_export;

 $record = new FS::part_export \%hash;
 $record = new FS::part_export { 'column' => 'value' };

 #($new_record, $options) = $template_recored->clone( $svcpart );

 $error = $record->insert( { 'option' => 'value' } );
 $error = $record->insert( \%options );

 $error = $new_record->replace($old_record);

 $error = $record->delete;

 $error = $record->check;

DESCRIPTION

An FS::part_export object represents an export of Freeside data to an external provisioning system. FS::part_export inherits from FS::Record. The following fields are currently supported:

exportnum - primary key; machine - Machine name; exporttype - Export type; nodomain - blank or "Y" : usernames are exported to this service with no domain

METHODS

new HASHREF
Creates a new export. To add the export to the database, see "insert".
Note that this stores the hash reference, not a distinct copy of the hash it points to. You can ask the object for a copy with the hash method.
insert HASHREF
Adds this record to the database. If there is an error, returns the error, otherwise returns false.
If a hash reference of options is supplied, part_export_option records are created (see FS::part_export_option).
delete
Delete this record from the database.
check
Checks all fields to make sure this is a valid export. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
svc_x
Returns a list of associated FS::svc_* records.
cust_svc
Returns a list of associated FS::cust_svc records.
export_svc
Returns a list of associated FS::export_svc records.
part_export_option
Returns all options as FS::part_export_option objects (see FS::part_export_option).
options
Returns a list of option names and values suitable for assigning to a hash.
option OPTIONNAME
Returns the option value for the given name, or the empty string.
_rebless
Reblesses the object into the FS::part_export::EXPORTTYPE class, where EXPORTTYPE is the object's exporttype field. There should be better docs on how to create new exports, but until then, see "NEW EXPORT CLASSES".
export_insert SVC_OBJECT; export_replace NEW OLD; export_delete; export_suspend; export_unsuspend; export_links SVC_OBJECT ARRAYREF
Adds a list of web elements to ARRAYREF specific to this export and SVC_OBJECT. The elements are displayed in the UI to lead the the operator to external configuration, monitoring, and similar tools.

SUBROUTINES

export_info [ SVCDB ]
Returns a hash reference of the exports for the given svcdb, or if no svcdb is specified, for all exports. The keys of the hash are exporttypes and the values are again hash references containing information on the export:

 'desc'     => 'Description',
 'options'  => {
                 'option'  => { label=>'Option Label' },
                 'option2' => { label=>'Another label' },
               },
 'nodomain' => 'Y', #or ''
 'notes'    => 'Additional notes',

NEW EXPORT CLASSES

A module should be added in FS/FS/part_export/ (an example may be found in eg/export_template.pm)

BUGS

Hmm... cust_export class (not necessarily a database table...) ... ?

deprecated column...

SEE ALSO

FS::part_export_option, FS::export_svc, FS::svc_acct, FS::svc_domain, FS::svc_forward, FS::Record, schema.html from the base documentation.

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 78:
=cut found outside a pod block. Skipping to next block.