NAME

Bric - The Bricolage base class.

VERSION

Release Version: 1.4.4

File (CVS) Version:

$Revision: 1.23.2.5 $

DATE

$Date: 2002/10/08 19:24:08 $

SYNOPSIS

use base qw( Bric );

DESCRIPTION

The Bric class is an abstract class should never be used directly. Instead new classes should be derived from it.

METHODS

Public Class Methods

$self = Bric->new($init)

Call this constructor from all derived classes. This sets up some basic fields and methods.

Throws:

NONE

Side Effects

NONE

Notes:

NONE

$self = Bric->lookup($obj_id)

This method is similar to the 'new' method except it is used only to retrieve a already existing object of this type from the database whereas 'new' creates a new, empty object. Since this operation is highly class dependent the code template for this function is the same as for the 'new' method.

Throws:

NONE

Side Effects

NONE

Notes:

On failure, this method returns zero (0) if no records were found and undef if there was a failure on the lookup itself.

$self = Bric->list($param)

This is an abstract method. All derived classes should override this method.

Throws:

"list method not implemented"

Thrown when no list method is available.

Side Effects

NONE

Notes:

$self = Bric->list_ids(...)

This is an abstract method. All derived classes should override this method. This method returns a list of IDs rather than objects.

Throws:

Side Effects

NONE

Notes:

$self = $obj->DESTROY(...)

This is the default destructor method. Even if nothing is defined within it, it should still be here so that Perl wont waste time trying to find it in the AUTOLOAD section.

Throws:

NONE

Side Effects

NONE

Notes:

die "...";

Uses confess rather than die to report errors.

Throws:

Its a 'thrower'.

Side Effects

Halts program execution

Notes:

warn "...";

Uses cluck rather than warn to output warnings.

Throws:

Its a 'thrower'.

Side Effects

Outputs a warning message

Notes:

Bric::register_fields({'field1' => Bric::FIELD_READ, ...})

This function is used by sub classes to register their field names and assign access levels to them.

Throws:

"Unable to register field names"

Side Effects

Defines a subroutine named ACCESS() in the caller's package.

Notes:

Private Class Methods

Public Instance Methods

$val = $obj->get_field
$obj = $obj->set_field

This is the AUTOLOAD handler. It translates all set and get operations into subroutines acting upon the fields in derived classes.

Throws:

Side Effects

Creates a custom subroutine reference in the calling packages namespace

Notes:

$ids = $obj->get_grp_ids();

Get a list of grp IDs of groups this object belongs to.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$success = $obj->register_instance();

Add the current object to the appropriate group in the database. These are groups that contain every instance of a particular type of object.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$success = $obj->unregister_instance();

Add the current object to the appropriate group in the database. These are groups that contain every instance of a particular type of object.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$success = $obj->save();

Save the current object to the database.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

Private Instance Methods

$obj->_get__dirty()
$obj->_set__dirty()

Get and set the _dirty field

Throws: NONE.

Side Effects NONE.

Notes: NONE.

$obj = $obj->_set(\%keyvals);
$obj = $obj->_set(\@keys, \@values);

The internal function used to set field values. Can be called with either a hash reference of keys and their corresponding values, or as two array references, one containing all the keys, the other containing all the values

Throws:

Side Effects NONE.

Notes: NONE.

@vals || $val = $obj->_get(@keys);

The internal function used to get field values. It accepts a list of key values to retrieve from the object.

Throws:

Problems retrieving field 'foo'

Side Effects

NONE

Notes:

Error checking and exception throwing is only performed in QA_MODE for performance reasons.

$vals = $obj->_get_ref(@keys);

The internal function used to get field values and return them as an arrayref. It accepts a list of key values to retrieve from the object.

Throws:

NONE

Side Effects

NONE

Notes:

AUTHOR

"Garth Webb" <garth@perijove.com>

Sam Tregar <stregar@about-inc.com>

SEE ALSO

NONE

POD ERRORS

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

Around line 355:

You forgot a '=back' before '=head2'

Around line 367:

'=item' outside of any '=over'

Around line 634:

You forgot a '=back' before '=head2'

Around line 643:

'=item' outside of any '=over'

Around line 821:

You forgot a '=back' before '=head1'