GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Maypole::Model::CDBI::FromCGI(3) User Contributed Perl Documentation Maypole::Model::CDBI::FromCGI(3)

Maypole::Model:CDBI::FromCGI - Validate form input and populate Model objects

  $obj = $class->create_from_cgi($r);
  $obj = $class->create_from_cgi($r, { params => {data1=>...}, required => [..],
                 ignore => [...], all => [...]);
  $obj = $class->create_from_cgi($h, $options); # CDBI::FromCGI style, see docs

  $obj->update_from_cgi($r);
  $obj->update_from_cgi($h, $options);

  $obj = $obj->add_to_from_cgi($r);
  $obj = $obj->add_to_from_cgi($r, { params => {...} } );

  # This does not work like in CDBI::FromCGI and probably never will :
  # $class->update_from_cgi($h, @columns);

Provides a way to validate form input and populate Model Objects, based on Class::DBI::FromCGI.

Replicates Class::DBI::FromCGI method of same name :

  __PACKAGE__->untaint_columns(
    printable => [qw/Title Director/],
    integer   => [qw/DomesticGross NumExplodingSheep],
    date      => [qw/OpeningDate/],
  );

  gets the  untaint type for a column as set in "untaint_types"

Returns errors that ocurred during an operation.

Based on the same method in Class::DBI::FromCGI.

Creates multiple objects from a cgi form. Errors are returned in cgi_update_errors

It can be called Maypole style passing the Maypole request object as the first arg, or Class::DBI::FromCGI style passing the Untaint Handler ($h) as the first arg.

A hashref of options can be passed as the second argument. Unlike in the CDBI equivalent, you can *not* pass a list as the second argument. Options can be : params -- hashref of cgi data to use instead of $r->params, required -- list of fields that are required ignore -- list of fields to ignore all -- list of all fields (defaults to $class->columns)

Replicates the Class::DBI::FromCGI method of same name. It updates an object and returns 1 upon success. It can take the same arguments as create_form_cgi. If errors, it sets the cgi_update_errors.

$obj->add_to_from_cgi($r[, $opts]);

Like add_to_* for has_many relationships but will add nay objects it can figure out from the data. It returns a list of objects it creates or nothing on error. Call cgi_update_errors with the calling object to get errors. Fatal errors are in the respective "FATAL" key.

Validates (untaints) a hash of possibly mixed table data. Returns validated and errors ($validated, $errors). If no errors then undef in that spot.

$self->validate_inputs($h, $opts);

This is the main validation method to validate inputs for a single class. Most of the time you use validate_all.

Returns validated and errors.

If no errors then undef in that slot.

Note: This method is currently experimental (in 2.11) and may be subject to change without notice.

$self->classify_form_inputs($params[, $delimiter]);

Foreign inputs are inputs that have data for a related table. They come named so we can tell which related class they belong to. This assumes the form : $accessor . $delimeter . $column recursively classifies them into hashes. It returns a hashref.

Maypole Developers

Peter Speltz, Aaron Trevena

Tony Bowden

* Tests * add_to_from_cgi, search_from_cgi * complete documentation * ensure full backward compatibility with Class::DBI::FromCGI

Please direct all correspondence regarding this module to: Maypole list.

Copyright 2003-2004 by Peter Speltz

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Class::DBI, Class::DBI::FromCGI
2007-05-18 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.