Myco::Query::Part - a Myco entity class
use Myco; # Constructors. See Myco::Entity for more. my $obj = Myco::Query::Part->new; # Accessors: # see attribute list below $obj->save; $obj->destroy;
This class abstracts the idea of a part of a Myco::QueryTemplate object. A part can be a filter (see Myco::Query::Part::Filter) or clause (Myco::Query::Part::Clause). A filter can itself contain clauses, thereby introducing the possibility (indeed, the routine requirement) of recursiveness in the construction of a query object.
Constructor, accessors, and other methods -- as inherited from Myco::Entity.
Attributes may be initially set during object construction (with new()) but otherwise are accessed solely through accessor methods. Typical usage:
new()
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.
eval
Get attribute value
$value = $obj->get_attribute;
A listing of available attributes follows:
type: string values: &, ||, 'and', 'or'
The perl (tangram) operator used to join one Myco::Query::Part object to the next.
type: int values: 1, 0 (yes/no)
Boolean value indicating whether the given query clause (and its attendant parameters) is optional.
Copyright (c) 2006 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.
Myco::Query::Part::Test, Myco::Entity, Myco, Tangram, Class::Tangram, myco-mkentity
To install Myco, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Myco
CPAN shell
perl -MCPAN -e shell install Myco
For more information on module installation, please visit the detailed CPAN module installation guide.