Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

jifty::dbi::filter(3pm) [debian man page]

Jifty::DBI::Filter(3pm) 				User Contributed Perl Documentation				   Jifty::DBI::Filter(3pm)

NAME
Jifty::DBI::Filter - base class for Jifty::DBI filters SYNOPSIS
# To implement your own filter package MyApp::Filter::Uppercase; use base qw/ Jifty::DBI::Filter /; # Setup for DB storage, store in lowercase sub encode { my $self = shift; my $value_ref = $self->value_ref; return unless defined $$value_ref; # don't blow up on undef $$value_ref = lc $$value_ref; } # Setup for Perl code to use, always sees uppercase sub decode { my $self = shift; my $value_ref = $self->value_ref; return unless defined $$value_ref; # don't blow up on undef $$value_ref = uc $$value_ref; } # To use a filter use MyApp::Record schema { column filtered => type is 'text', filters are qw/ MyApp::Filter::Uppercase /; }; DESCRIPTION
A filter allows Jifty::DBI models to tweak data prior to being stored and/or loaded. This is useful for marshalling and unmarshalling complex objects. METHODS
new Takes three arguments in a parameter hash: value_ref A reference to the current value you're going to be massaging. "encode" works in place, massaging whatever value_ref refers to. column A Jifty::DBI::Column object, whatever sort of column we're working with here. handle A Jifty::DBI::Handle object, because some filters (i.e. Jifty::DBI::Filter::Boolean) depend on what database system is being used. encode "encode" takes data that users are handing to us and marshals it into a form suitable for sticking it in the database. This could be anything from flattening a DateTime object into an ISO date to making sure that data is utf8 clean. decode "decode" takes data that the database is handing back to us and gets it into a form that's OK to hand back to the user. This could be anything from inflating an ISO date to a DateTime object to making sure that the string properly has the utf8 flag. SEE ALSO
Jifty::DBI::Filter::Date, Jifty::DBI::Filter::DateTime, Jifty::DBI::Filter:SaltHash, Jifty::DBI::Filter::Storable, Jifty::DBI::Filter::Time, Jifty::DBI::Filter::Truncate, Jifty::DBI::Filter::YAML, Jifty::DBI::Filter::base64, Jifty::DBI::Filter::utf8 LICENSE
Jifty::DBI is Copyright 2005-2007 Best Practical Solutions, LLC. Jifty::DBI is distributed under the same terms as Perl itself. perl v5.14.2 2010-12-09 Jifty::DBI::Filter(3pm)

Check Out this Related Man Page

Jifty::Handle(3pm)					User Contributed Perl Documentation					Jifty::Handle(3pm)

NAME
Jifty::Handle -- A database handle class for Jifty DESCRIPTION
A wrapper around Jifty::DBI::Handle which is aware of versions in the database METHODS
new PARAMHASH This class method instantiates a new Jifty::Handle object. This object deals with database handles for the system. After it is created, it will be a subclass of Jifty::DBI::Handle. canonical_database_name Returns the canonical name of the application's database (the actual name that will be given to the database driver). This name is a lower-case version of the "Database" argument in the "Database" section of the framework config. For SQLite databases (where the database name is actually a filename), this also converts a relative path into an absolute path based at the application root. connect ARGS Like Jifty::DBI's connect method but pulls the name of the database from the current Jifty::Config. check_schema_version [pretend => 0|1] Make sure that we have a recent enough database schema. If we don't, then error out. If "pretend =" 1> is passed, then any auto-upgrade action this might take is dry-run only. create_database MODE "MODE" is either "print" or "execute". This method either prints the commands necessary to create the database or actually creates it, depending on the value of MODE. Returns undef on failure. drop_database MODE "MODE" is either "print" or "execute". This method either prints the commands necessary to drop the database or actually drops it, depending on the value of MODE. Returns undef on failure. AUTHOR
Various folks at BestPractical Solutions, LLC. perl v5.14.2 2011-01-24 Jifty::Handle(3pm)
Man Page