man Bric::Util::Grp::Parts::Member () - A Class for associating Members of a Group with attribute with in the group

NAME

Bric::Util::Grp::Parts::Member - A Class for associating Members of a Group with attribute with in the group

VERSION

$LastChangedRevision$

DATE

$LastChangedDate: 2004-08-12 17:13:34 -0700 (Thu, 12 Aug 2004) $

SYNOPSIS

  # Constructors.
  my $member = Bric::Util::Grp::Parts::Member->new( $initial_state );
  $member = Bric::Util::Grp::Parts::Member->lookup( { id => $id} );
  my ($member_list||@members) = Bric::Util::Grp::Parts::Member->list($params);
  my $member_href = Bric::Util::Grp::Parts::Member->href($params);

  # Class methods.
  ($ids || @ids ) = Bric::Util::Grp::Parts::Member->list_ids({grp => $grp })

  # Instances methods.
  my $id = $member->get_id;
  $member = $member->activate;
  $member = $member->deactivate;

  # Attribute methods.
  $member = $member->set_attrs( [name=> $name,subsys=> $subsys,val => $val}]);
  ($val_list||@vals) = $member->get_attrs([ {name=> $name,subsys=> $subsys}]);

  # Retrieve the underlying Bric object.
  $object = $member->get_object;

DESCRIPTION

A Member is a container for an object and any properties that it may have with in the group it is associated with that it would not have by its self.

INTERFACE

Constructors

This will create a new member object with the defined initial state Supported Keys:

object_class_id
object_package
grp
active
Throws: NONE. Side Effects: NONE. Notes: NONE. Looks up a member object for a given ID. Throws: NONE. Side Effects: NONE. Notes: NONE.
($mbr_list||@mbrs) = Bric::Util::Grp::Parts::Member->list($params);
This will return a list or list ref of blessed Member objects that are a member of said a group. The CW$params hash reference supports the following keys:
grp
A Bric::Util::Grp object, the members of which are to be returned.
grp_package
The package name of a Bric::Util::Grp subclass, the members of which are to be returned.
object
A Bric object for which a list of group memberships will be returned.
object_package
The package name of a Bric object for which a list of group memberships will be returned. Use in combination with the CWobject_id parameter.
object_id
The ID of a Bric object for which a list of group memberships will be returned. Use in combination with the CWobject_package parameter. Throws: NONE. Side Effects: NONE. Notes: NONE. Returns an anonymous hash of group members. The hash values are Bric::Util::Grp::Parts::Member objects. Takes the same arguments as the CWlist() method, although either the CWgrp or CWgrp_package parameter is required. If the group class method CWget_object_class_id() returns a value, then the hash keys will be the IDs of the objecs represented by the members. Otherwise, the keys will be the IDs of the member objects themselves. Throws: NONE. Side Effects: NONE. Notes: NONE.

Destructors

$contrib->DESTROY
Dummy method to prevent wasting time trying to AUTOLOAD DESTROY. Throws: NONE. Side Effects: NONE. Notes: NONE.

Public Class Methods

($ids||@ids ) = Bric::Util::Grp::Parts::Member->list_ids($params);
Return a list or anonymous array of Member object ids. The supported keys in the CW$params hash reference are the same as for the CWlist() method. Throws: NONE. Side Effects: NONE. Notes: NONE.
$meths = Bric::Util::Grp::Parts::Member->my_meths
Returns an anonymous hash of introspection data for this object. If called with a true argument, it will return an ordered list or anonymous array of introspection data. If a second true argument is passed instead of a first, then a list or anonymous array of introspection data will be returned for properties that uniquely identify an object (excluding CWid, which is assumed). Each hash key is the name of a property or attribute of the object. The value for a hash key is another anonymous hash containing the following keys:
name
The name of the property or attribute. Is the same as the hash key when an anonymous hash is returned.
disp
The display name of the property or attribute.
get_meth
A reference to the method that will retrieve the value of the property or attribute.
get_args
An anonymous array of arguments to pass to a call to get_meth in order to retrieve the value of the property or attribute.
set_meth
A reference to the method that will set the value of the property or attribute.
set_args
An anonymous array of arguments to pass to a call to set_meth in order to set the value of the property or attribute.
type
The type of value the property or attribute contains. There are only three types:
short
date
blob
len
If the value is a 'short' value, this hash key contains the length of the field.
search
The property is searchable via the list() and list_ids() methods.
req
The property or attribute is required.
props
An anonymous hash of properties used to display the property or attribute. Possible keys include:
type
The display field type. Possible values are
text
textarea
password
hidden
radio
checkbox
select
length
The Length, in letters, to display a text or password field.
maxlength
The maximum length of the property or value - usually defined by the SQL DDL.
rows
The number of rows to format in a textarea field.
cols
The number of columns to format in a textarea field.
vals
An anonymous hash of key/value pairs reprsenting the values and display names to use in a select list. Throws: NONE. Side Effects: NONE. Notes: NONE. Returns a list of the object ids that this object is a member of Throws: NONE Side Effects: NONE Notes: NONE

Public Instance Methods

returns the package of the object that is the member Throws: NONE Side Effects: NONE Notes: NONE Return the object that this member reflects Notes: The object class isn't loaded by the group class, so when using the Bric API outside of Bricolage, you need to require the object class on the fly; for example:

  my @members = $grp->get_members();
  foreach my $m (@members) {
      my $pkg = $m->get_object_package();
      eval "require $pkg";
      my $object = $m->get_object();
  }
Throws: NONE Side Effects: NONE Sets an individual attribute on this member Throws: NONE Side Effects: NONE Notes: NONE Deletes attributes from this member Throws: NONE Side Effects: NONE Notes: NONE Takes a list of attributes and sets them upon the member object. Throws: NONE Side Effects: Sets a value on the attribute object Notes: NONE returns a list of the subsystems in use Throws: NONE Side Effects: NONE Notes: NONE Returns a single attribute for the member. Throws: NONE Side Effects: Returns value from the attribute object Notes: NONE Returns the attributes defined for this member object. Throws: NONE Side Effects: Returns value from the attribute object Notes: NONE Sets meta information on the attributes Throws: NONE Side Effects: NONE Notes: NONE Deletes meta information for this member Throws: NONE Side Effects: NONE Notes: NONE Returns the meta information Throws: NONE Side Effects: NONE Notes: NONE Returns a hash ref of all Throws: NONE Side Effects: NONE Notes: NONE returns a hash ref of the attrs Throws: NONE Side Effects: NONE Notes: NONE This will return the id for the object Throws: NONE Side Effects: NONE Notes: NONE Activated a member object that has been deactivated Throws: NONE Side Effects: NONE Notes: NONE Make this member object inactive Throws: NONE Side Effects: NONE Notes: NONE This will return undef if the member has been deactivated and one otherwise. Throws: NONE Side Effects: NONE Notes: NONE This will delete the member from the database (as opposed to deactivating) Throws: NONE Side Effects: NONE Notes: NONE Saves changes to the data base Throws:
*
The grp_id or grp property is required. Side Effects: NONE Notes: NONE

PRIVATE

Private Class Methods

$results = _do_list($criteria);
Executes the query for the list constructors Throws: NONE Side Effects: NONE Notes: NONE

Private Instance Methods

Throws: NONE Side Effects: NONE Notes: NONE Will return the proper mapping table name Throws: NONE Side Effects: NONE Notes: NONE Returns the package name for a given class id Throws: NONE Side Effects: NONE Notes: NONE Returns the group that this is a member of Throws: NONE Side Effects: NONE Notes: NONE Returns a list or listref of subsys names Throws: NONE Side Effects: NONE Notes: NONE Will set an attribute on this member Throws: NONE Side Effects NONE Notes: NONE check for attributes on the member, will check the group and the group's parents if the flags are passed Throws: NONE Side Effects: NONE Notes: NONE Deletes meta information from the attribute object or the cache Throws: NONE Side Effects: NONE Notes: NONE Deletes attributes from the attribute object or its cache Throws: NONE Side Effects: NONE Notes: NONE Returns a hash of the attributes that match the parameters. It will also return default values from the group if the CW$group argument is passed. Throws: NONE Side Effects: NONE Notes: NONE Sets meta information on the member attributes Throws: NONE Side Effects: NONE Notes: NONE Returns meta information for a given attribute. Will check the group and the groups parents for defaults if the flags have been passed. Throws: NONE Side Effects: NONE Notes: NONE Returns the correct attribute object for this member Throws: NONE Side Effects: NONE Notes: NONE Called by save this preforms all the updates for the attribute object Throws: NONE Side Effects: NONE Notes: NONE Handles the sql to prefore a delete from the database Throws: NONE Side Effects: NONE Notes: NONE Preforms an update to the database Throws: NONE Side Effects: NONE Side Effects: NONE Preforms the sql for an insert into the member tables Throws: NONE Side Effects: NONE Notes: NONE

NOTES

NONE

AUTHOR

michael soderstrom ( miraso@pacbell.net )

SEE ALSO

Bric, Bric::Util::Grp, Bric::Util::Attribute