Difference between revisions of "Freeside:3:Documentation:Developer/FS/access group"

From Freeside
Jump to: navigation, search
m (Edit via perl MediaWiki framework (1.13))
m (Edit via perl MediaWiki framework (1.13))
Line 1: Line 1:
 +
==NAME==
 +
FS::access_group - Object methods for access_group records
  
 +
==SYNOPSIS==
 +
<code>
 +
  use FS::access_group;
 +
 +
  $record = new FS::access_group \%hash;
 +
  $record = new FS::access_group { 'column' => 'value' };
 +
 +
  $error = $record->insert;
 +
 +
  $error = $new_record->replace($old_record);
 +
 +
  $error = $record->delete;
 +
 +
  $error = $record->check;
 +
</code>
 +
==DESCRIPTION==
 +
An FS::access_group object represents an access group. FS::access_group inherits from FS::Record. The following fields are currently supported:
 +
 +
; groupnum - primary key; groupname - Access group name
 +
==METHODS==
 +
; new HASHREF
 +
:Creates a new access group. To add the access group to the database, see [[#insert|"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 access group. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
 +
; access_groupagent
 +
:Returns all associated FS::access_groupagent records.
 +
; access_rights
 +
:Returns all associated FS::access_right records.
 +
; access_right RIGHTNAME
 +
:Returns the specified FS::access_right record. Can be used as a boolean, to test if this group has the given RIGHTNAME.
 +
 +
==BUGS==
 +
==SEE ALSO==
 +
[[Freeside:3:Documentation:Developer/FS/Record|FS::Record]], schema.html from the base documentation.

Revision as of 13:30, 27 June 2014

NAME

FS::access_group - Object methods for access_group records

SYNOPSIS

 use FS::access_group;

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

 $error = $record->insert;

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

 $error = $record->delete;

 $error = $record->check;

DESCRIPTION

An FS::access_group object represents an access group. FS::access_group inherits from FS::Record. The following fields are currently supported:

groupnum - primary key; groupname - Access group name

METHODS

new HASHREF
Creates a new access group. To add the access group 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 access group. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
access_groupagent
Returns all associated FS::access_groupagent records.
access_rights
Returns all associated FS::access_right records.
access_right RIGHTNAME
Returns the specified FS::access_right record. Can be used as a boolean, to test if this group has the given RIGHTNAME.

BUGS

SEE ALSO

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