packaging one directory
|
1 |
package DBIx::Custom::Result; |
updatedd pod
|
2 |
use Object::Simple -base; |
cleanup
|
3 | |
packaging one directory
|
4 |
use Carp 'croak'; |
cleanup
|
5 |
use DBIx::Custom::Util qw/_array_to_hash _subname/; |
packaging one directory
|
6 | |
- changed EXPERIMENTAL DBIx:...
|
7 |
has [qw/filters sth/], |
8 |
stash => sub { {} }; |
|
cleanup
|
9 | |
- added DBIx::Custom::Result...
|
10 |
*all = \&fetch_hash_all; |
11 | ||
cleanup
|
12 |
sub filter { |
13 |
my $self = shift; |
|
cleanup
|
14 |
|
cleanup
|
15 |
# Set |
cleanup
|
16 |
if (@_) { |
17 |
|
|
cleanup
|
18 |
# Convert filter name to subroutine |
19 |
my $filter = @_ == 1 ? $_[0] : [@_]; |
|
20 |
$filter = _array_to_hash($filter); |
|
cleanup
|
21 |
foreach my $column (keys %$filter) { |
22 |
my $fname = $filter->{$column}; |
|
fix bug : filter can't over...
|
23 |
if (exists $filter->{$column} |
24 |
&& defined $fname |
|
25 |
&& ref $fname ne 'CODE') |
|
26 |
{ |
|
cleanup
|
27 |
croak qq{Filter "$fname" is not registered" } . _subname |
cleanup
|
28 |
unless exists $self->filters->{$fname}; |
29 |
$filter->{$column} = $self->filters->{$fname}; |
|
30 |
} |
|
cleanup
|
31 |
} |
cleanup
|
32 |
|
cleanup
|
33 |
# Merge |
added experimental DBIx::Cus...
|
34 |
$self->{filter} = {%{$self->filter}, %$filter}; |
cleanup
|
35 |
|
36 |
return $self; |
|
cleanup
|
37 |
} |
38 |
|
|
added experimental DBIx::Cus...
|
39 |
return $self->{filter} ||= {}; |
40 |
} |
|
41 | ||
- changed EXPERIMENTAL DBIx:...
|
42 |
sub filter_off { |
43 |
my $self = shift; |
|
44 |
$self->{filter_off} = 1; |
|
45 |
return $self; |
|
46 |
} |
|
47 | ||
48 |
sub filter_on { |
|
49 |
my $self = shift; |
|
50 |
$self->{filter_off} = 0; |
|
51 |
return $self; |
|
52 |
} |
|
53 | ||
packaging one directory
|
54 |
sub fetch { |
changed argument of tag proc...
|
55 |
my $self = shift; |
56 |
|
|
packaging one directory
|
57 |
# Fetch |
changed argument of tag proc...
|
58 |
my @row = $self->{sth}->fetchrow_array; |
update document
|
59 |
return unless @row; |
added check_filter attribute
|
60 |
|
cleanup
|
61 |
# Filtering |
added experimental iterate_a...
|
62 |
my $columns = $self->{sth}->{NAME}; |
added type_rule method and f...
|
63 |
my $types = $self->{sth}->{TYPE}; |
EXPERIMENTAL type_rule argum...
|
64 |
my $type_rule1 = $self->type_rule->{from1} || {}; |
65 |
my $type_rule2 = $self->type_rule->{from2} || {}; |
|
separate DBIx::Custom::Resul...
|
66 |
my $filter = $self->filter; |
67 |
my $end_filter = $self->end_filter; |
|
cleanup
|
68 |
for (my $i = 0; $i < @$columns; $i++) { |
added type_rule method and f...
|
69 |
|
separate DBIx::Custom::Resul...
|
70 |
# Column |
cleanup
|
71 |
my $column = $columns->[$i]; |
some changed
|
72 |
|
separate DBIx::Custom::Resul...
|
73 |
# Type rule |
EXPERIMENTAL type_rule argum...
|
74 |
my $type_filter1 = $type_rule1->{lc($types->[$i])}; |
75 |
$row[$i] = $type_filter1->($row[$i]) |
|
76 |
if $type_filter1 && !$self->{type_rule_off} |
|
77 |
&& !$self->{type_rule1_off}; |
|
78 |
my $type_filter2 = $type_rule2->{lc($types->[$i])}; |
|
79 |
$row[$i] = $type_filter2->($row[$i]) |
|
80 |
if $type_filter2 && !$self->{type_rule_off} |
|
81 |
&& !$self->{type_rule2_off}; |
|
separate DBIx::Custom::Resul...
|
82 |
|
83 |
# Filter |
|
84 |
my $filter = $filter->{$column} || $self->{default_filter}; |
|
85 |
$row[$i] = $filter->($row[$i]) |
|
86 |
if $filter && !$self->{filter_off}; |
|
87 |
$row[$i] = $end_filter->{$column}->($row[$i]) |
|
88 |
if $end_filter->{$column} && !$self->{filter_off}; |
|
packaging one directory
|
89 |
} |
many many changes
|
90 | |
removed reconnect method
|
91 |
return \@row; |
92 |
} |
|
93 | ||
cleanup
|
94 |
sub fetch_all { |
95 |
my $self = shift; |
|
96 |
|
|
97 |
# Fetch all rows |
|
98 |
my $rows = []; |
|
cleanup
|
99 |
while(my $row = $self->fetch) { push @$rows, $row} |
100 |
|
|
cleanup
|
101 |
return $rows; |
102 |
} |
|
103 | ||
removed reconnect method
|
104 |
sub fetch_first { |
105 |
my $self = shift; |
|
106 |
|
|
107 |
# Fetch |
|
108 |
my $row = $self->fetch; |
|
109 |
return unless $row; |
|
110 |
|
|
111 |
# Finish statement handle |
|
112 |
$self->sth->finish; |
|
113 |
|
|
114 |
return $row; |
|
115 |
} |
|
116 | ||
packaging one directory
|
117 |
sub fetch_hash { |
changed argument of tag proc...
|
118 |
my $self = shift; |
119 |
|
|
packaging one directory
|
120 |
# Fetch |
changed argument of tag proc...
|
121 |
my $row = $self->{sth}->fetchrow_arrayref; |
packaging one directory
|
122 |
return unless $row; |
added check_filter attribute
|
123 | |
packaging one directory
|
124 |
# Filter |
separate DBIx::Custom::Resul...
|
125 |
my $hash_row = {}; |
126 |
my $filter = $self->filter; |
|
127 |
my $end_filter = $self->end_filter || {}; |
|
added experimental iterate_a...
|
128 |
my $columns = $self->{sth}->{NAME}; |
added type_rule method and f...
|
129 |
my $types = $self->{sth}->{TYPE}; |
EXPERIMENTAL type_rule argum...
|
130 |
my $type_rule1 = $self->type_rule->{from1} || {}; |
131 |
my $type_rule2 = $self->type_rule->{from2} || {}; |
|
cleanup
|
132 |
for (my $i = 0; $i < @$columns; $i++) { |
update document
|
133 |
|
separate DBIx::Custom::Resul...
|
134 |
# Column |
cleanup
|
135 |
my $column = $columns->[$i]; |
EXPERIMENTAL type_rule argum...
|
136 |
$hash_row->{$column} = $row->[$i]; |
add query filter error check
|
137 |
|
separate DBIx::Custom::Resul...
|
138 |
# Type rule |
EXPERIMENTAL type_rule argum...
|
139 |
my $type_filter1 = $type_rule1->{lc($types->[$i])}; |
140 |
$hash_row->{$column} = $type_filter1->($hash_row->{$column}) |
|
141 |
if !$self->{type_rule_off} && !$self->{type_rule1_off} |
|
142 |
&& $type_filter1; |
|
143 |
my $type_filter2 = $type_rule2->{lc($types->[$i])}; |
|
144 |
$hash_row->{$column} = $type_filter2->($hash_row->{$column}) |
|
145 |
if !$self->{type_rule_off} && !$self->{type_rule2_off} |
|
146 |
&& $type_filter2; |
|
separate DBIx::Custom::Resul...
|
147 |
|
148 |
# Filter |
|
149 |
my $f = $filter->{$column} || $self->{default_filter}; |
|
150 |
$hash_row->{$column} = $f->($hash_row->{$column}) |
|
151 |
if $f && !$self->{filter_off}; |
|
152 |
$hash_row->{$column} = $end_filter->{$column}->($hash_row->{$column}) |
|
153 |
if $end_filter->{$column} && !$self->{filter_off}; |
|
packaging one directory
|
154 |
} |
155 |
|
|
separate DBIx::Custom::Resul...
|
156 |
return $hash_row; |
packaging one directory
|
157 |
} |
158 | ||
cleanup
|
159 |
sub fetch_hash_all { |
160 |
my $self = shift; |
|
161 |
|
|
162 |
# Fetch all rows as hash |
|
163 |
my $rows = []; |
|
cleanup
|
164 |
while(my $row = $self->fetch_hash) { push @$rows, $row } |
cleanup
|
165 |
|
166 |
return $rows; |
|
167 |
} |
|
168 | ||
removed reconnect method
|
169 |
sub fetch_hash_first { |
packaging one directory
|
170 |
my $self = shift; |
171 |
|
|
172 |
# Fetch hash |
|
173 |
my $row = $self->fetch_hash; |
|
174 |
return unless $row; |
|
175 |
|
|
176 |
# Finish statement handle |
|
some changed
|
177 |
$self->sth->finish; |
packaging one directory
|
178 |
|
removed reconnect method
|
179 |
return $row; |
packaging one directory
|
180 |
} |
181 | ||
renamed fetch_rows to fetch_...
|
182 |
sub fetch_hash_multi { |
packaging one directory
|
183 |
my ($self, $count) = @_; |
184 |
|
|
cleanup
|
185 |
# Fetch multiple rows |
cleanup
|
186 |
croak 'Row count must be specified ' . _subname |
packaging one directory
|
187 |
unless $count; |
188 |
my $rows = []; |
|
189 |
for (my $i = 0; $i < $count; $i++) { |
|
removed reconnect method
|
190 |
my $row = $self->fetch_hash; |
191 |
last unless $row; |
|
192 |
push @$rows, $row; |
|
packaging one directory
|
193 |
} |
194 |
|
|
195 |
return unless @$rows; |
|
removed reconnect method
|
196 |
return $rows; |
packaging one directory
|
197 |
} |
198 | ||
cleanup
|
199 |
sub fetch_multi { |
200 |
my ($self, $count) = @_; |
|
packaging one directory
|
201 |
|
cleanup
|
202 |
# Row count not specifed |
cleanup
|
203 |
croak 'Row count must be specified ' . _subname |
cleanup
|
204 |
unless $count; |
205 |
|
|
206 |
# Fetch multi rows |
|
packaging one directory
|
207 |
my $rows = []; |
cleanup
|
208 |
for (my $i = 0; $i < $count; $i++) { |
209 |
my $row = $self->fetch; |
|
210 |
last unless $row; |
|
removed reconnect method
|
211 |
push @$rows, $row; |
packaging one directory
|
212 |
} |
changed argument of tag proc...
|
213 |
|
cleanup
|
214 |
return unless @$rows; |
removed reconnect method
|
215 |
return $rows; |
packaging one directory
|
216 |
} |
217 | ||
- added DBIx::Custom::Result...
|
218 |
*one = \&fetch_hash_first; |
219 | ||
added EXPERIMENTAL DBIx::Cus...
|
220 |
sub type_rule { |
221 |
my $self = shift; |
|
222 |
|
|
223 |
if (@_) { |
|
EXPERIMENTAL type_rule argum...
|
224 |
my $type_rule = ref $_[0] eq 'HASH' ? $_[0] : {@_}; |
225 | ||
226 |
# From |
|
227 |
foreach my $i (1 .. 2) { |
|
228 |
$type_rule->{"from$i"} = _array_to_hash($type_rule->{"from$i"}); |
|
229 |
foreach my $data_type (keys %{$type_rule->{"from$i"} || {}}) { |
|
230 |
croak qq{data type of from$i section must be lower case or number} |
|
231 |
if $data_type =~ /[A-Z]/; |
|
232 |
my $fname = $type_rule->{"from$i"}{$data_type}; |
|
233 |
if (defined $fname && ref $fname ne 'CODE') { |
|
234 |
croak qq{Filter "$fname" is not registered" } . _subname |
|
235 |
unless exists $self->filters->{$fname}; |
|
236 |
|
|
237 |
$type_rule->{"from$i"}{$data_type} = $self->filters->{$fname}; |
|
238 |
} |
|
added EXPERIMENTAL DBIx::Cus...
|
239 |
} |
240 |
} |
|
EXPERIMENTAL type_rule argum...
|
241 |
$self->{type_rule} = $type_rule; |
DBIx::Custom::Result type_ru...
|
242 |
|
243 |
return $self; |
|
added EXPERIMENTAL DBIx::Cus...
|
244 |
} |
245 |
|
|
EXPERIMENTAL type_rule argum...
|
246 |
return $self->{type_rule} || {}; |
added EXPERIMENTAL DBIx::Cus...
|
247 |
} |
248 | ||
- changed EXPERIMENTAL DBIx:...
|
249 |
sub type_rule_off { |
250 |
my $self = shift; |
|
251 |
$self->{type_rule_off} = 1; |
|
252 |
return $self; |
|
253 |
} |
|
254 | ||
255 |
sub type_rule_on { |
|
256 |
my $self = shift; |
|
257 |
$self->{type_rule_off} = 0; |
|
258 |
return $self; |
|
259 |
} |
|
260 | ||
261 |
sub type_rule1_off { |
|
262 |
my $self = shift; |
|
263 |
$self->{type_rule1_off} = 1; |
|
264 |
return $self; |
|
265 |
} |
|
266 | ||
267 |
sub type_rule1_on { |
|
268 |
my $self = shift; |
|
269 |
$self->{type_rule1_off} = 0; |
|
270 |
return $self; |
|
271 |
} |
|
272 | ||
273 |
sub type_rule2_off { |
|
274 |
my $self = shift; |
|
275 |
$self->{type_rule2_off} = 1; |
|
276 |
return $self; |
|
277 |
} |
|
278 | ||
279 |
sub type_rule2_on { |
|
280 |
my $self = shift; |
|
281 |
$self->{type_rule2_off} = 0; |
|
282 |
return $self; |
|
283 |
} |
|
284 | ||
cleanup
|
285 |
# DEPRECATED! |
286 |
sub end_filter { |
|
287 |
my $self = shift; |
|
288 |
if (@_) { |
|
289 |
my $end_filter = {}; |
|
cleanup
|
290 |
if (ref $_[0] eq 'HASH') { $end_filter = $_[0] } |
291 |
else { |
|
cleanup
|
292 |
$end_filter = _array_to_hash( |
293 |
@_ > 1 ? [@_] : $_[0] |
|
294 |
); |
|
295 |
} |
|
296 |
foreach my $column (keys %$end_filter) { |
|
297 |
my $fname = $end_filter->{$column}; |
|
298 |
if (exists $end_filter->{$column} |
|
299 |
&& defined $fname |
|
300 |
&& ref $fname ne 'CODE') |
|
301 |
{ |
|
302 |
croak qq{Filter "$fname" is not registered" } . _subname |
|
303 |
unless exists $self->filters->{$fname}; |
|
304 |
$end_filter->{$column} = $self->filters->{$fname}; |
|
305 |
} |
|
306 |
} |
|
307 |
$self->{end_filter} = {%{$self->end_filter}, %$end_filter}; |
|
308 |
return $self; |
|
309 |
} |
|
310 |
return $self->{end_filter} ||= {}; |
|
311 |
} |
|
312 | ||
cleanup
|
313 |
# DEPRECATED! |
added experimental DBIx::Cus...
|
314 |
sub remove_end_filter { |
315 |
my $self = shift; |
|
cleanup
|
316 |
warn "remove_end_filter is DEPRECATED! use filter_off attribute instead"; |
added experimental DBIx::Cus...
|
317 |
$self->{end_filter} = {}; |
318 |
return $self; |
|
319 |
} |
|
320 | ||
cleanup
|
321 |
# DEPRECATED! |
added experimental DBIx::Cus...
|
322 |
sub remove_filter { |
323 |
my $self = shift; |
|
cleanup
|
324 |
warn "remove_filter is DEPRECATED! use filter_off attribute instead"; |
added experimental DBIx::Cus...
|
325 |
$self->{filter} = {}; |
326 |
return $self; |
|
327 |
} |
|
328 | ||
cleanup
|
329 |
# DEPRECATED! |
cleanup
|
330 |
sub default_filter { |
331 |
my $self = shift; |
|
cleanup
|
332 |
warn "default_filter is DEPRECATED!"; |
cleanup
|
333 |
if (@_) { |
334 |
my $fname = $_[0]; |
|
335 |
if (@_ && !$fname) { |
|
336 |
$self->{default_filter} = undef; |
|
337 |
} |
|
338 |
else { |
|
many changed
|
339 |
croak qq{Filter "$fname" is not registered} |
cleanup
|
340 |
unless exists $self->filters->{$fname}; |
341 |
$self->{default_filter} = $self->filters->{$fname}; |
|
342 |
} |
|
343 |
return $self; |
|
344 |
} |
|
345 |
return $self->{default_filter}; |
|
346 |
} |
|
347 | ||
cleanup
|
348 |
# DEPRECATED! |
cleanup
|
349 |
has 'filter_check'; |
cleanup
|
350 | |
update document
|
351 |
1; |
352 | ||
packaging one directory
|
353 |
=head1 NAME |
354 | ||
cleanup
|
355 |
DBIx::Custom::Result - Result of select statement |
packaging one directory
|
356 | |
update document
|
357 |
=head1 SYNOPSIS |
cleanup
|
358 | |
removed reconnect method
|
359 |
# Result |
cleanup
|
360 |
my $result = $dbi->select(table => 'book'); |
cleanup
|
361 | |
cleanup
|
362 |
# Fetch a row and put it into array reference |
removed reconnect method
|
363 |
while (my $row = $result->fetch) { |
cleanup
|
364 |
my $author = $row->[0]; |
365 |
my $title = $row->[1]; |
|
version 0.0901
|
366 |
} |
367 |
|
|
cleanup
|
368 |
# Fetch only a first row and put it into array reference |
removed reconnect method
|
369 |
my $row = $result->fetch_first; |
370 |
|
|
cleanup
|
371 |
# Fetch all rows and put them into array of array reference |
removed reconnect method
|
372 |
my $rows = $result->fetch_all; |
cleanup
|
373 | |
cleanup
|
374 |
# Fetch a row and put it into hash reference |
removed reconnect method
|
375 |
while (my $row = $result->fetch_hash) { |
cleanup
|
376 |
my $title = $row->{title}; |
377 |
my $author = $row->{author}; |
|
packaging one directory
|
378 |
} |
removed reconnect method
|
379 |
|
cleanup
|
380 |
# Fetch only a first row and put it into hash reference |
removed reconnect method
|
381 |
my $row = $result->fetch_hash_first; |
cleanup
|
382 |
my $row = $result->one; # Same as fetch_hash_first |
removed reconnect method
|
383 |
|
cleanup
|
384 |
# Fetch all rows and put them into array of hash reference |
removed reconnect method
|
385 |
my $rows = $result->fetch_hash_all; |
cleanup
|
386 |
my $rows = $result->all; # Same as fetch_hash_all |
packaging one directory
|
387 | |
update document
|
388 |
=head1 ATTRIBUTES |
packaging one directory
|
389 | |
cleanup
|
390 |
=head2 C<filters> |
391 | ||
392 |
my $filters = $result->filters; |
|
cleanup
|
393 |
$result = $result->filters(\%filters); |
cleanup
|
394 | |
cleanup
|
395 |
Filters. |
cleanup
|
396 | |
397 |
=head2 C<sth> |
|
398 | ||
399 |
my $sth = $reuslt->sth |
|
400 |
$result = $result->sth($sth); |
|
401 | ||
402 |
Statement handle of L<DBI>. |
|
403 | ||
update document
|
404 |
=head1 METHODS |
405 | ||
renamed build_query to creat...
|
406 |
L<DBIx::Custom::Result> inherits all methods from L<Object::Simple> |
cleanup
|
407 |
and implements the following new ones. |
packaging one directory
|
408 | |
updated pod
|
409 |
=head2 C<all> |
410 | ||
411 |
my $rows = $result->all; |
|
412 | ||
cleanup
|
413 |
Same as C<fetch_hash_all>. |
updated pod
|
414 | |
removed DBIx::Custom commit ...
|
415 |
=head2 C<fetch> |
packaging one directory
|
416 | |
cleanup
|
417 |
my $row = $result->fetch; |
version 0.0901
|
418 | |
cleanup
|
419 |
Fetch a row and put it into array reference. |
packaging one directory
|
420 | |
removed DBIx::Custom commit ...
|
421 |
=head2 C<fetch_all> |
packaging one directory
|
422 | |
cleanup
|
423 |
my $rows = $result->fetch_all; |
version 0.0901
|
424 | |
cleanup
|
425 |
Fetch all rows and put them into array of array reference. |
packaging one directory
|
426 | |
cleanup
|
427 |
=head2 C<fetch_first> |
428 | ||
429 |
my $row = $result->fetch_first; |
|
430 | ||
cleanup
|
431 |
Fetch only a first row and put it into array reference, |
432 |
and finish statment handle. |
|
cleanup
|
433 | |
removed DESTROY method(not b...
|
434 |
=head2 C<fetch_hash> |
packaging one directory
|
435 | |
cleanup
|
436 |
my $row = $result->fetch_hash; |
packaging one directory
|
437 | |
cleanup
|
438 |
Fetch a row and put it into hash reference. |
update document
|
439 | |
cleanup
|
440 |
=head2 C<fetch_hash_all> |
441 | ||
442 |
my $rows = $result->fetch_hash_all; |
|
443 | ||
cleanup
|
444 |
Fetch all rows and put them into array of hash reference. |
cleanup
|
445 | |
removed DBIx::Custom commit ...
|
446 |
=head2 C<fetch_hash_first> |
removed reconnect method
|
447 |
|
cleanup
|
448 |
my $row = $result->fetch_hash_first; |
packaging one directory
|
449 | |
cleanup
|
450 |
Fetch only a first row and put it into hash reference, |
451 |
and finish statment handle. |
|
packaging one directory
|
452 | |
removed DESTROY method(not b...
|
453 |
=head2 C<fetch_hash_multi> |
update document
|
454 | |
cleanup
|
455 |
my $rows = $result->fetch_hash_multi(5); |
update document
|
456 |
|
cleanup
|
457 |
Fetch multiple rows and put them into array of hash reference. |
update document
|
458 | |
cleanup
|
459 |
=head2 C<fetch_multi> |
packaging one directory
|
460 | |
cleanup
|
461 |
my $rows = $result->fetch_multi(5); |
462 |
|
|
cleanup
|
463 |
Fetch multiple rows and put them into array of array reference. |
removed DESTROY method(not b...
|
464 | |
cleanup
|
465 |
=head2 C<filter> |
466 | ||
cleanup
|
467 |
$result->filter(title => sub { uc $_[0] }, author => 'to_upper'); |
468 |
$result->filter([qw/title author/] => 'to_upper'); |
|
added experimental DBIx::Cus...
|
469 | |
cleanup
|
470 |
Set filter for column. |
471 |
You can use subroutine or filter name as filter. |
|
- DBIx::Custom Model filter ...
|
472 |
This filter is executed after C<type_rule> filter. |
cleanup
|
473 | |
- changed EXPERIMENTAL DBIx:...
|
474 |
=head2 C<filter_off> EXPERIMENTAL |
475 | ||
476 |
$result = $result->filter_off; |
|
477 | ||
478 |
Turn filtering by C<filter> method off. |
|
479 |
By default, filterin is on. |
|
480 | ||
481 |
=head2 C<filter_on> EXPERIMENTAL |
|
482 | ||
483 |
$result = $resutl->filter_on; |
|
484 | ||
485 |
Turn filtering by C<filter> method on. |
|
486 |
By default, filterin is on. |
|
487 | ||
updated pod
|
488 |
=head2 C<one> |
489 | ||
490 |
my $row = $result->one; |
|
491 | ||
cleanup
|
492 |
Same as C<fetch_hash_first>. |
added experimental DBIx::Cus...
|
493 | |
- removed DEPRECATED DBIx::C...
|
494 |
=head2 C<stash> |
added experimental DBIx::Cus...
|
495 | |
496 |
my $stash = $result->stash; |
|
497 |
my $foo = $result->stash->{foo}; |
|
498 |
$result->stash->{foo} = $foo; |
|
499 | ||
cleanup
|
500 |
Stash is hash reference for data. |
added experimental DBIx::Cus...
|
501 | |
added EXPERIMENTAL DBIx::Cus...
|
502 |
=head2 C<type_rule> EXPERIMENTAL |
cleanup
|
503 |
|
504 |
# Merge type rule |
|
added EXPERIMENTAL DBIx::Cus...
|
505 |
$result->type_rule( |
506 |
# DATE |
|
507 |
9 => sub { ... }, |
|
508 |
# DATETIME or TIMESTAMP |
|
509 |
11 => sub { ... } |
|
510 |
); |
|
511 | ||
cleanup
|
512 |
# Replace type rule(by reference) |
513 |
$result->type_rule([ |
|
514 |
# DATE |
|
515 |
9 => sub { ... }, |
|
516 |
# DATETIME or TIMESTAMP |
|
517 |
11 => sub { ... } |
|
518 |
]); |
|
EXPERIMENTAL type_rule_off i...
|
519 | |
cleanup
|
520 |
This is same as L<DBIx::Custom>'s C<type_rule>'s <from>. |
EXPERIMENTAL type_rule_off i...
|
521 | |
- changed EXPERIMENTAL DBIx:...
|
522 |
=head2 C<type_rule_off> EXPERIMENTAL |
523 | ||
524 |
$result = $result->type_rule_off; |
|
525 | ||
526 |
Turn C<from1> and C<from2> type rule off. |
|
527 |
By default, type rule is on. |
|
528 | ||
529 |
=head2 C<type_rule_on> EXPERIMENTAL |
|
530 | ||
531 |
$result = $result->type_rule_on; |
|
532 | ||
533 |
Turn C<from1> and C<from2> type rule on. |
|
534 |
By default, type rule is on. |
|
535 | ||
536 |
=head2 C<type_rule1_off> EXPERIMENTAL |
|
537 | ||
538 |
$result = $result->type_rule1_off; |
|
539 | ||
540 |
Turn C<from1> type rule off. |
|
541 |
By default, type rule is on. |
|
542 | ||
543 |
=head2 C<type_rule1_on> EXPERIMENTAL |
|
544 | ||
545 |
$result = $result->type_rule1_on; |
|
546 | ||
547 |
Turn C<from1> type rule on. |
|
548 |
By default, type rule is on. |
|
549 | ||
550 |
=head2 C<type_rule2_off> EXPERIMENTAL |
|
551 | ||
552 |
$result = $result->type_rule2_off; |
|
553 | ||
554 |
Turn C<from2> type rule off. |
|
555 |
By default, type rule is on. |
|
556 | ||
557 |
=head2 C<type_rule2_on> EXPERIMENTAL |
|
558 | ||
559 |
$result = $result->type_rule2_on; |
|
560 | ||
561 |
Turn C<from2> type rule on. |
|
562 |
By default, type rule is on. |
|
563 | ||
packaging one directory
|
564 |
=cut |