NAME

Myco::Query::Part::Filter - a Myco entity class

VERSION

Release

0.01

Repository

$Revision$ $Date$

SYNOPSIS

  use Myco;

  # Constructors. See Myco::Base::Entity for more.
  my $obj = Myco::Query::Part::Filter->new;

  # Accessors.
  my $value = $obj->get_fooattrib;
  $obj->set_fooattrib($value);

  $obj->save;
  $obj->destroy;

DESCRIPTION

Blah blah blah... Blah blah blah... Blah blah blah... Blah blah blah blah blah... Blah blah...

COMMON ENTITY INTERFACE

Constructor, accessors, and other methods -- as inherited from Myco::Base::Entity.

ATTRIBUTES

Attributes may be initially set during object construction (with new()) but otherwise are accessed solely through accessor methods. Typical usage:

  • Set attribute value

     $obj->set_attribute($value);

    Check functions (see Class::Tangram) perform data validation. If there is any concern that the set method might be called with invalid data then the call should be wrapped in an eval block to catch exceptions that would result.

  • Get attribute value

     $value = $obj->get_attribute;

A listing of available attributes follows:

parts

 type: transient

An array of the parts of the query filter. These parts consist of clauses and (potentially) other filter objects.

relevance

 type: transient - boolean (1 | 0)

A boolean attribute that determines if a Filter is 'relevant', i.e. whether its inclusion in a query should be by default even if none of the params relevant to it were passed at query-run-time. On its own, this attribute is useless. To dynamically determine if a filter is relevant just prior to query-run-time, use $filter->is_relevant( %query_run_params ).

ADDED CLASS / INSTANCE METHODS

add_part

  $query_filter->add_part( $query_part );

Pushes a Myco::Query::Part object onto the end of the parts array.

remove_part

  $query_filter->remove_part( $query_part );

Deletes a Myco::Query::Part object from the parts array. Accpets and object reference or an object ID.

get_combined_parts

  my $filter_string = $query_filter->get_combined_parts;

Returns all the filter parts into a string.

is_relevant

  my $is_relevant = $query_filter->is_relevant( \%query_run_time_params );

Calculates whether this filter is relevant to its containing query - i.e. its clauses having to do with 'remote' object comparison will be ignored if their attendant paramters were not passed to run_query.

LICENSE AND COPYRIGHT

Copyright (c) 2004 the myco project. All rights reserved. This software is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

FILTER::Test, Myco::Base::Entity, Myco, Tangram, Class::Tangram, mkentity