NAME

XAS::Service::Profiles::Search - A class for creating standard validation profiles.

SYNOPSIS

my $params = {
    start => 0,
    limit => 25,
};

my $fields = qw(id server queue requestor typeofrequest status startdatetime);
my $search = XAS::Service::Profiles::Search->new($fields);
my $validate = XAS::Service::Validate->new($search);
my $results = $validate->check($params, 'pager');

if ($results->has_invalid) {

    my @invalids = $results->invalid;

    foreach $invalid (@invalids) {

        printf("%s: %s\n", $invalid, $results->msgs->{$invalide});

    }

}

DESCRIPTION

This module creates a standardized Data::FormValidator validation profile for searches.

METHODS

new($fields)

Initializes the vaildation profile.

$field

An array ref of field names that may appear in search requests.

SEE ALSO

XAS::Service
XAS

AUTHOR

Kevin L. Esteb, <kevin@kesteb.us>

COPYRIGHT AND LICENSE

Copyright (c) 2012-2016 Kevin L. Esteb

This is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0. For details, see the full text of the license at http://www.perlfoundation.org/artistic_license_2_0.