Bric::Biz::OutputChannel::Element(3p)

NAME
Bric::Biz::OutputChannel::Element - Maps Output Channels to Element Types.

VERSION
$LastChangedRevision$

DATE
$LastChangedDate: 2006-03-18 01:26:34 +0100 (Sat, 18 Mar 2006) $

SYNOPSIS
  use Bric::Biz::OutputChannel::Element;

  # Constructors.
  my $oce = Bric::Biz::OutputChannel->new($init);
  my $oces_href = Bric::Biz::OutputChannel->href($params);

  # Instance methods.
  my $element_type_id = $oce->get_element_type_id;
  $oce->set_element_type_id($element_type_id);
  $oce->set_enabled_on;
  $oce->set_enabled_off;
  if ($oce->is_enabled) { } # do stuff.
  $oce->save;

DESCRIPTION
This subclass of Bric::Biz::OutputChannel manages the relationship between output channels and elements (Bric::Biz::ElementType objects). It does so by providing accessors to properties relevant to the relationship, as well as an "href()" method to help along the use of a Bric::Util::Coll object.

INTERFACE
This class inherits the majority of its interface from Bric::Biz::OutputChannel. Only additional methods are documented here.

  Constructors

my $oce = Bric::Biz::OutputChannel::Element->new($init);
    Constructs a new Bric::Biz::OutputChannel::Element object intialized with the values in the $init hash reference and returns it. The suported values for the $init hash reference are the same as those supported by "Bric::Biz::OutputChannel::Element->new", with the addition of the following:

    "oc_id"
        The ID of the output channel object on which the new Bric::Biz::OutputChannel::Element will be based. The relevant Bric::Biz::OutputChannel object will be looked up from the database. Note that all of the $init parameters documented in Bric::Biz::OutputChannel will be ignored if this parameter is passed.

    "oc"
        The output channel object on which the new Bric::Biz::OutputChannel::Element will be based. Note that all of the $init parameters documented in Bric::Biz::OutputChannel will be ignored if this parameter is passed.

    "element_type_id"
        The ID of the Bric::Biz::ElementType object to which this output channel is mapped.

    "enabled"
        A boolean value indicating whether the output channel will have assets output to it by default.

    Throws:

    *   Unable to connect to database.

    *   Unable to prepare SQL statement.

    *   Unable to select column into arrayref.

    *   Unable to execute SQL statement.

    *   Unable to bind to columns to statement handle.

    *   Unable to fetch row from statement handle.

    Side Effects: If you pass in an output channel object via the "oc" parameter, that output channel object will be converted into a Bric::Biz::OutputChannel::Element object.

    Notes: NONE.

my $oce_href = Bric::Biz::OutputChannel::Element->href({ element_type_id => $eid });
    Returns a hash reference of Bric::Biz::OutputChannel::Element objects. Each hash key is a Bric::Biz::OutputChannel::Element ID, and the values are the corresponding Bric::Biz::OutputChannel::Element objects. Only a single parameter argument is allowed, "element_type_id", though "ANY" may be used to specify a list of element type IDs. All of the output channels associated with that element type ID will be returned.

    Throws:

    *   Unable to connect to database.

    *   Unable to prepare SQL statement.

    *   Unable to select column into arrayref.

    *   Unable to execute SQL statement.

    *   Unable to bind to columns to statement handle.

    *   Unable to fetch row from statement handle.

    Side Effects: NONE.

    Notes: NONE.

##############################################################################

  Public Instance Methods

my $eid = $oce->get_element_type_id
    Returns the ID of the Element Type definition with which this output channel is associated.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

$oce = $oce->set_element_type_id($eid)
    Sets the ID of the Element type definition with which this output channel is associated.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

$oce = $oce->set_enabled_on
    Enables this output channel to have assets ouptut to it by default.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

$oce = $oce->set_enabled_off
    Sets this output channel to not have assets ouptut to it by default.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

$oce = $oce->is_enabled
    Returns true if the this output channel is set to have assets output to it by default, and false if it is not.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

$oce = $oce->remove
    Marks this output channel-element type association to be removed. Call the "save()" method to remove the mapping from the database.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

$oce = $oce->save
    Saves the output channel.

    Throws:

    *   Bric::_get() - Problems retrieving fields.

    *   Unable to connect to database.

    *   Unable to prepare SQL statement.

    *   Unable to execute SQL statement.

    *   Unable to select row.

    *   Incorrect number of args to _set.

    *   Bric::_set() - Problems setting fields.

    Side Effects: NONE.

    Notes: NONE.

NOTES
NONE.

AUTHOR
David Wheeler <david@justatheory.com>

SEE ALSO
Bric::Biz::OutputChannel, Bric::Biz::ElementType,