packaging one directory
|
1 |
package DBIx::Custom::Query; |
cleanup
|
2 |
use base 'Object::Simple::Base'; |
packaging one directory
|
3 | |
update document
|
4 |
use strict; |
5 |
use warnings; |
|
6 | ||
catch up with Object::Simple...
|
7 |
__PACKAGE__->attr([qw/sql key_infos bind_filter fetch_filter sth/]); |
cleanup
|
8 |
__PACKAGE__->attr(_no_bind_filters => sub { {} }); |
catch up with Object::Simple...
|
9 |
__PACKAGE__->attr(no_fetch_filters => sub { [] }); |
packaging one directory
|
10 | |
cleanup
|
11 |
sub new { |
12 |
my $self = shift->SUPER::new(@_); |
|
13 |
|
|
cleanup
|
14 |
$self->no_bind_filters($self->{no_bind_filters}) |
15 |
if $self->{no_bind_filters}; |
|
cleanup
|
16 |
|
17 |
return $self; |
|
18 |
} |
|
packaging one directory
|
19 | |
cleanup
|
20 |
sub no_bind_filters { |
21 |
my $self = shift; |
|
22 |
|
|
23 |
if (@_) { |
|
24 |
$self->{no_bind_filters} = $_[0]; |
|
25 |
|
|
26 |
my %no_bind_filters = map { $_ => 1 } @{$self->{no_bind_filters}}; |
|
27 |
|
|
28 |
$self->_no_bind_filters(\%no_bind_filters); |
|
29 |
|
|
30 |
return $self; |
|
31 |
} |
|
32 |
|
|
33 |
return $self->{no_bind_filters}; |
|
34 |
} |
|
35 | ||
packaging one directory
|
36 |
=head1 NAME |
37 | ||
update document
|
38 |
DBIx::Custom::Query - DBIx::Custom query |
packaging one directory
|
39 | |
40 |
=head1 SYNOPSIS |
|
41 |
|
|
version 0.0901
|
42 |
# New |
43 |
my $query = DBIx::Custom::Query->new; |
|
44 |
|
|
45 |
# Create by using create_query |
|
46 |
my $query = DBIx::Custom->create_query($template); |
|
47 |
|
|
48 |
# Set attributes |
|
packaging one directory
|
49 |
$query->bind_filter($dbi->filters->{default_bind_filter}); |
50 |
$query->no_bind_filters('title', 'author'); |
|
51 |
|
|
52 |
$query->fetch_filter($dbi->filters->{default_fetch_filter}); |
|
53 |
$query->no_fetch_filters('title', 'author'); |
|
54 | ||
update document
|
55 |
=head1 Accessors |
packaging one directory
|
56 | |
57 |
=head2 sth |
|
58 | ||
update document
|
59 |
Set and get statement handle |
60 | ||
version 0.0901
|
61 |
$query = $query->sth($sth); |
62 |
$sth = $query->sth; |
|
packaging one directory
|
63 | |
64 |
=head2 sql |
|
65 | ||
update document
|
66 |
Set and get SQL |
67 | ||
version 0.0901
|
68 |
$query = $query->sql($sql); |
69 |
$sql = $query->sql; |
|
packaging one directory
|
70 | |
71 |
=head2 bind_filter |
|
72 | ||
update document
|
73 |
Set and get bind filter |
74 | ||
version 0.0901
|
75 |
$query = $query->bind_filter($bind_filter); |
76 |
$bind_filter = $query->bind_filter; |
|
packaging one directory
|
77 | |
78 |
=head2 no_bind_filters |
|
79 | ||
update document
|
80 |
Set and get keys of no filtering |
81 | ||
version 0.0901
|
82 |
$query = $query->no_bind_filters($no_filters); |
83 |
$no_bind_filters = $query->no_bind_filters; |
|
packaging one directory
|
84 | |
85 |
=head2 fetch_filter |
|
86 | ||
update document
|
87 |
Set and get fetch filter |
88 | ||
version 0.0901
|
89 |
$query = $query->fetch_filter($fetch_filter); |
90 |
$fetch_filter = $query->fetch_filter; |
|
packaging one directory
|
91 | |
92 |
=head2 no_fetch_filters |
|
93 | ||
update document
|
94 |
Set and get keys of no filtering |
95 | ||
version 0.0901
|
96 |
$query = $query->no_fetch_filters($no_filters); |
97 |
$no_fetch_filters = $query->no_fetch_filters; |
|
packaging one directory
|
98 | |
99 |
=head2 key_infos |
|
100 | ||
update document
|
101 |
Set and get key informations |
102 | ||
version 0.0901
|
103 |
$query = $query->key_infos($key_infos); |
104 |
$key_infos = $query->key_infos; |
|
packaging one directory
|
105 | |
cleanup
|
106 |
=head1 Methods |
107 | ||
108 |
=head2 new |
|
109 | ||
110 |
my $query = DBIx::Custom::Query->new; |
|
111 |
|
|
packaging one directory
|
112 |
=head1 AUTHOR |
113 | ||
114 |
Yuki Kimoto, C<< <kimoto.yuki at gmail.com> >> |
|
115 | ||
116 |
Github L<http://github.com/yuki-kimoto> |
|
117 | ||
118 |
=head1 COPYRIGHT & LICENSE |
|
119 | ||
120 |
Copyright 2009 Yuki Kimoto, all rights reserved. |
|
121 | ||
122 |
This program is free software; you can redistribute it and/or modify it |
|
123 |
under the same terms as Perl itself. |