NAME

Bric::Group - A Class for associating Objects 

VERSION

$Revision: 1.1.1.1.2.2 $

DATE

$Date: 2001/11/06 23:18:32 $

SYNOPSIS

$group = Bric::Group->new();

$group = $group->set_name( $name )

$name = $group->get_name()

$group = $group->set_description()

$desc = $group->get_description()

$id = $group->get_id()

$success = $group->delete() || $success = Bric::Group->delete( $group_id )

($member || undef) = Bric::Group->is_associated( 
        ($obj || {type => $t, id => $id} ), $group_id ,$attr )

$group = $group->set_members( [$obj || { type => $type, id => $id}] )

(@members || $member_aref) = $group->get_members()

$group = $group->delete_members([$obj || $member || {type=> $t,id=> $id}])

($member || undef) = $group->has_member( 
        ($obj || {type => $t, id => $id}, $attr )

$attr_obj = $group->get_attr_obj()

(@vals || $val_aref) = 
        $group->get_member_attrs( [ { name => $name, subsys => $subsys} ])

$success = $group->set_member_attrs(
        [ { name => $name, subsys => $subsys, value => $value } ] )


(@vals || $val_aref) =
        $group->get_group_attrs( [ $name ])

$success = $group->set_group_attrs(
        [ { name => $name, value => $value } ] )

$group = $group->save()

DESCRIPTION

Group is a class that associates Objects together.   These can be
assigned Attributes as a group or to the member class which will 
allow attributes to be set on an object in association with a group.

INTERFACE

Public Methods

$group = Bric::Group->new()
This will create a new group object

notes:

throws: None

side effects: None

notes: None

$group = Bric::Group->lookup( $criteria )
This will lookup an existing group based on the given criteria, usualy 
$criteria = { id => $id }

throws: None

side effects: None

notes: None

(@groups || $group_aref) = Bric::Group->list( $criteria )
Given the hash ref of args (what they might be will be defined in a bit)
this will return a list or a list ref of objects that match.

throws: None

side effects: None

notes: None

$success = Bric::Group->delete( [$group] );
This will remove the group(s) that are passed as args

throws: None

side effects: None

notes: None

($member || undef) = Bric::Group->is_associated( ($obj || { type => $t, id => $id }), $group, $attributes)
This will take an object ( or it's unique identifiers) and a group ( or it's 
unique identifiers) and an optional set of attributes and will return the 
member object if said object is a member of said group with the stated 
attributes

throws: None

side effects: None

notes:

$name = $group->get_name( )
Returns the name that has been given to the group

throws: None

side effects: None

notes:

$group = $group->set_name( $name )
sets the name to the given name

throws: None

side effects: None

notes:

$desc = $group->get_description( )
Returns the description that was given to the group 

throws: None

side effects: None

notes:

$group = $group->set_description( $desc )
Sets the description to the given argument

throws: None

side effects: None

notes:

$id = $group->get_id()
Returns the database id of the group object

throws: None

side effects: None

notes: None

$group = $group->activate()
makes an inactive group active again

throws: None

side effects: None

notes: None

$group = $group->deactivate()
Makes a group inactive

throws: None

side effects: None

notes: None

(1 || undef ) = $group->is_active()
Returns 1 if the group is active, undef if it is inactive

throws: None

side effects: None

notes: None

$success = $group->set_members( [{obj => ($obj || $unique_ids), attr => $attributes }]);
Takes a list of hash refs with the keys ob obj which has a value of the 
object (or its unique identifiers) and attr which will be the attributes that
are placed on the member object.   This will add the object to the group.

throws: None

side effects: None

notes: None

(@members || $member_aref) = $group->get_members();
Returns a list or a list ref of the member objects that are in the group

throws: None

side effects: None

notes: None

$success = $self->delete_members([$obj||$members||{type=>$t,id=>$id}]);
Takes a lsit of objects or their unique identifiers ard removes them from the
group

throws: None

side effects: None

notes: None

($member || undef) = $group->has_member( ( {type=> $t,id=> $id} || $obj), $attr);
Responds with the member object if object is a member or undef otherwise

throws: None

side effects:

notes:

$attr_obj = $group->get_attr_obj()
Returns the attribute object that is associated with the group

throws: None

side effects: None

notes: None

$group = $group->set_member_attrs( [ { name => $name, subsys => $subsys, value => $value } ] )
Set default attributes for members of the group.   These can be over rided
by setting the attributes of the member.

throws: None

side effects: None

notes: None

(@vals || $val_aref) = $group->get_member_attrs( [ { name => $name, subsys => $subsys} ])
Retrieves the value of the attribute that has been assigned as a default
for members that has the given name and subsystem

throws: None

side effects: None

notes:

(@vals || $val_aref) = $group->get_group_attrs( [ $name ])
Get attributes that describe the group but do not apply to members.
This retrieves the value in the attribute object from a special subsystem 
which contains these.   This will be returned as a list of values

throws: None

side effects: None

notes: None

$group = $group->set_group_attrs([{ name => $name, value => $value }])
Sets attributes that describe the group but do not apply to members.
This sets the value in the attribute object to a special subsystem 
which contains these

throws: None

side effects: None

notes: None

$group = $group->save()
Updates the database to reflect the changes made to the object

throws: None

side effects: None

notes: None

Private Methods

NOTES

This module is still in progress.

AUTHOR

michael soderstrom ( miraso@pacbell.net )

SEE ALSO

Bric.pm

POD ERRORS

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

Around line 644:

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

Around line 661:

=back without =over