Name

Bric::Util::Grp::Parts::Member::Contrib - Manages Contributors (members of Bric::Util::Grp::Person groups, that is).

Synopsis

See Bric::Util::Grp::Parts::Member.

Description

See Bric::Util::Grp::Parts::Member.

Interface

Constructors

See Bric::Util::Grp::Parts::Member. Only lookup() is implemented here.

my $contrib = Bric::Util::Grp::Parts::Member::Contrib->lookup({ id => $id })

Looks up and instantiates a new Bric::Util::Grp::Parts::Member::Contrib object based on the Bric::Util::Grp::Parts::Member::Contrib object ID passed. If $id is not found in the database, lookup() returns undef.

Throws:

Side Effects: If $id is found, populates the new Bric::Util::Grp::Parts::Member::Contrib object with data from the database before returning it.

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

See Bric::Util::Grp::Parts::Member. Only my_meths() is overridden here.

$meths = Bric::Util::Grp::Parts::Member::Contrib->my_meths
(@meths || $meths_aref) = Bric::Util::Grp::Parts::Member::Contrib->my_meths(TRUE)
my (@meths || $meths_aref) = Bric::Util::Grp::Parts::Member::Contrib->my_meths(0, TRUE)

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 id, 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.

Public Instance Methods

See Also Bric::Util::Grp::Parts::Member.

$roles = $contrib->get_roles

Return the roles for this contributor

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$info = $contrib->get_role_info

Return information for a particular role

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$person = $contrib->get_person

Return the person object behind this contributor

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

my $val = $contrib->get_data($attr);

Shortcut for the default method of getting attributes from a group member, which is

$member->get_attr({ name => $attr });

By including this convenience method, contributor objects act more like story elements, so it'll be easier for template writers to use.

$ids = $obj->get_grp_ids();

Get a list of grp IDs of groups this object belongs to. Overrides the default implementation because it needs the group memeberships of the underlying person object, rather than of the contributor object.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

Private

Private Class Methods

See Bric::Util::Grp::Parts::Member.

Private Instance Methods

my (@contribs || $contribs_aref) = $member->_do_list($params)

Returns a list or anonymous array of members of a Bric::Util::Grp::Person group or groups. The supported keys for the $params anonymous hash are:

Throws:

Side Effects: NONE.

Notes: NONE.

Private Functions

Notes

NONE.

Author

David Wheeler <david@justatheory.com>

See Also

Bric, Bric::Util::Grp, Bric::Util::Grp::Person, Bric::Util::Grp::Parts::Member