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