Difference between revisions of "Freeside:3:Documentation:Developer/FS/part device"

From Freeside
Jump to: navigation, search
m (Edit via perl MediaWiki framework (1.13))
 
m (Edit via perl MediaWiki framework (1.13))
 
Line 23: Line 23:
 
:primary key
 
:primary key
 
; devicename
 
; devicename
:devicename
+
:device name (used in Freeside)
 
; inventory_classnum
 
; inventory_classnum
 +
:[[Freeside:3:Documentation:Developer/FS/inventory class|FS::inventory_class]] used to track inventory of these devices.
 +
; title
 +
:external device name (for export)
 +
 
==METHODS==
 
==METHODS==
 
; new HASHREF
 
; new HASHREF

Latest revision as of 07:20, 28 September 2015

NAME

FS::part_device - Object methods for part_device records

SYNOPSIS

 use FS::part_device;

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

 $error = $record->insert;

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

 $error = $record->delete;

 $error = $record->check;

DESCRIPTION

An FS::part_device object represents a phone device definition. FS::part_device inherits from FS::Record. The following fields are currently supported:

devicepart
primary key
devicename
device name (used in Freeside)
inventory_classnum
FS::inventory_class used to track inventory of these devices.
title
external device name (for export)

METHODS

new HASHREF
Creates a new record. To add the record 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
Adds this record to the database. If there is an error, returns the error, otherwise returns false.
delete
Delete this record from the database.
replace OLD_RECORD
Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.
check
Checks all fields to make sure this is a valid record. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
part_export
Returns a list of all exports (see FS::part_export) for this device.
inventory_class
Returns the inventory class (see FS::inventory_class) for this device, if any.

BUGS

SEE ALSO

FS::Record, schema.html from the base documentation.