| Class-DBI-Plugin-AccessionSearch documentation | Contained in the Class-DBI-Plugin-AccessionSearch distribution. |
Class::DBI::Plugin::AccessionSearch - easliy add search atters.
This documentation refers to Class::DBI::Plugin::AccessionSearch version 0.02
package Your::Data;
use base 'Class::DBI';
use Class::DBI::AccessionSearch;
in your script:
use Your::Data;
my $d = Your::Data->accession({status => 'ok'});
$d->accession_search({sex => 'male'});
$d->accession_search({status => 'ng'});
create Class::DBI::AccessionSearch object.
search_where's wrapper.
Atsushi Kobayashi, <nekokak at gmail.com>
Please report any bugs or feature requests to
bug-class-dbi-plugin-accessionsearch at rt.cpan.org, or through the web interface at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Class-DBI-Plugin-AccessionSearch.
I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc Class::DBI::Plugin::AccessionSearch
You can also look for information at:
http://cpanratings.perl.org/d/Class-DBI-Plugin-AccessionSearch
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Class-DBI-Plugin-AccessionSearch
http://search.cpan.org/dist/Class-DBI-Plugin-AccessionSearch
Copyright 2006 Atsushi Kobayashi, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Class-DBI-Plugin-AccessionSearch documentation | Contained in the Class-DBI-Plugin-AccessionSearch distribution. |
package Class::DBI::Plugin::AccessionSearch; use strict; use warnings; use base qw/Class::DBI::Plugin/; our $VERSION = '0.02'; sub accession : Plugged { my($pkg, $where, $attrs) = @_; my $param = { pkg => $pkg, where => $where, attrs => $attrs, }; bless $param , __PACKAGE__; } sub accession_search : Plugged { my ($self, $where, $attrs) = @_; $where ||= {}; $attrs ||= {}; my $our_where = $self->{where} || {}; my $new_where = { %{$our_where} , %{$where} }; my $our_atters = $self->{attrs} || {}; my $new_attrs = { %{$our_atters} , %{$attrs} }; $self->{where} = $new_where; $self->{attrs} = $new_attrs; return $self->{pkg}->search_where($new_where,$new_attrs); }
1; # End of Class::DBI::Plugin::AccessionSearch