Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

class::dbi::search::basic(3pm) [debian man page]

Class::DBI::Search::Basic(3pm)				User Contributed Perl Documentation			    Class::DBI::Search::Basic(3pm)

NAME
Class::DBI::Search::Basic - Simple Class::DBI search SYNOPSIS
my $searcher = Class::DBI::Search::Basic->new( $cdbi_class, @search_args ); my @results = $searcher->run_search; # Over in your Class::DBI subclass: __PACKAGE__->add_searcher( search => "Class::DBI::Search::Basic", isearch => "Class::DBI::Search::Plugin::CaseInsensitive", ); DESCRIPTION
This is the start of a pluggable Search infrastructure for Class::DBI. At the minute Class::DBI::Search::Basic doubles up as both the default search within Class::DBI as well as the search base class. We will probably need to tease this apart more later and create an abstract base class for search plugins. METHODS
new my $searcher = Class::DBI::Search::Basic->new( $cdbi_class, @search_args ); A Searcher is created with the class to which the results will belong, and the arguments passed to the search call by the user. opt if (my $order = $self->opt('order_by')) { ... } The arguments passed to search may contain an options hash. This will return the value of a given option. run_search my @results = $searcher->run_search; my $iterator = $searcher->run_search; Actually run the search. SUBCLASSING
sql / bind / fragment The actual mechanics of generating the SQL and executing it split up into a variety of methods for you to override. run_search() is implemented as: return $cdbi->sth_to_objects($self->sql, $self->bind); Where sql() is $cdbi->sql_Retrieve($self->fragment); There are also a variety of private methods underneath this that could be overridden in a pinch, but if you need to do this I'd rather you let me know so that I can make them public, or at least so that I don't remove them from under your feet. perl v5.12.4 2011-08-10 Class::DBI::Search::Basic(3pm)

Check Out this Related Man Page

Class::DBI::Relationship(3pm)				User Contributed Perl Documentation			     Class::DBI::Relationship(3pm)

NAME
Class::DBI::Relationship - base class for Relationships DESCRIPTION
A Class::DBI class represents a database table. But merely being able to represent single tables isn't really that useful - databases are all about relationships. So, Class::DBI provides a variety of Relationship models to represent common database occurences (HasA, HasMany and MightHave), and provides a way to add others. SUBCLASSING
Relationships should inherit from Class::DBI::Relationship, and provide a variety of methods to represent the relationship. For examples of how these are used see Class::DBI::Relationship::HasA, Class::DBI::Relationship::HasMany and Class::DBI::Relationship::MightHave. remap_arguments sub remap_arguments { my $self = shift; # process @_; return ($class, accessor, $foreign_class, $args) } Subclasses should define a 'remap_arguments' method that takes the arguments with which your relationship method will be called, and transforms them into the structure that the Relationship modules requires. If this method is not provided, then it is assumed that your method will be called with these 3 arguments in this order. This should return a list of 4 items: class The Class::DBI subclass to which this relationship applies. This will be passed in to you from the caller who actually set up the relationship, and is available for you to call methods on whilst performing this mapping. You should almost never need to change this. This usually an entire application base class (or Class::DBI itself), but could be a single class wishing to override a default relationship. accessor The method in the class which will provide access to the results of the relationship. foreign_class The class for the table with which the class has a relationship. args Any additional args that your relationship requires. It is recommended that you use this as a hashref to store any extra information your relationship needs rather than adding extra accessors, as this information will all be stored in the 'meta_info'. triggers sub triggers { return ( before_create => sub { ... }, after_create => sub { ... }, ); } Subclasses may define a 'triggers' method that returns a list of triggers that the relationship needs. This method can be omitted if there are no triggers to be set up. methods sub methods { return ( method1 => sub { ... }, method2 => sub { ... }, ); } Subclasses may define a 'methods' method that returns a list of methods to facilitate the relationship that should be created in the calling Class::DBI class. This method can be omitted if there are no methods to be set up. perl v5.12.4 2005-09-16 Class::DBI::Relationship(3pm)
Man Page