Tripletail
view release on metacpan or search on metacpan
lib/Tripletail/Pager.pm view on Meta::CPAN
# -----------------------------------------------------------------------------
# Tripletail::Pager - ãã¼ã¸ã³ã°å¦ç
# -----------------------------------------------------------------------------
package Tripletail::Pager;
use strict;
use warnings;
use Tripletail;
1;
sub _new {
my $class = shift;
my $DB = Tripletail::_isa($_[0], 'Tripletail::DB')
? shift
: $TL->getDB(shift);
my $this = bless {} => $class;
$this->{db } = $DB;
$this->{dbtype} = $DB->getType;
$this->{pagesize} = 30;
$this->{current} = 1;
$this->{maxlinks} = 10;
$this->{formkey} = 'pageid';
$this->{formparam} = undef;
$this->{pagingtype} = 0;
$this->{tolink} = undef;
#çµæç¾¤
$this->{maxpages} = undef;
$this->{linkstart} = undef;
$this->{linkend} = undef;
$this->{maxrows} = undef;
$this->{beginrow} = undef;
$this->{rows} = undef;
$this->setFormParam(undef);
$this;
}
sub setToLink {
my $this = shift;
my $tolink = shift;
if(ref($tolink)) {
die __PACKAGE__."#setToLinkp: arg[1] is a reference. [$tolink] (第1弿°ããªãã¡ã¬ã³ã¹ã§ã)\n";
}
$this->{tolink} = $tolink;
$this;
}
sub setDbGroup {
my $this = shift;
my $dbgroup = shift;
if(ref($dbgroup)) {
die __PACKAGE__."#setDbGroup: arg[1] is a reference. [$dbgroup] (第1弿°ããªãã¡ã¬ã³ã¹ã§ã)\n";
}
$this->{db } = $TL->getDB($dbgroup);
$this->{dbtype} = $this->{db}->getType;
$this;
}
sub setPageSize {
my $this = shift;
my $size = shift;
if(!defined($size)) {
die __PACKAGE__."#setPageSize: arg[1] is not defined. (第1弿°ãæå®ããã¦ãã¾ãã)\n";
} elsif(ref($size)) {
die __PACKAGE__."#setPageSize: arg[1] is a reference. [$size] (第1弿°ããªãã¡ã¬ã³ã¹ã§ã)\n";
} elsif($size !~ /^\d+$/ || $size <= 0) {
die __PACKAGE__."#setPageSize: arg[1] is not a positive number. [$size] (第1弿°ãæ£ã®æ´æ°ã§ã¯ããã¾ãã)\n";
}
( run in 1.079 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )