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 { |
|
- added EXPERIMENTAL order m...
|
287 |
warn "end_filter method is DEPRECATED!"; |
cleanup
|
288 |
my $self = shift; |
289 |
if (@_) { |
|
290 |
my $end_filter = {}; |
|
cleanup
|
291 |
if (ref $_[0] eq 'HASH') { $end_filter = $_[0] } |
292 |
else { |
|
cleanup
|
293 |
$end_filter = _array_to_hash( |
294 |
@_ > 1 ? [@_] : $_[0] |
|
295 |
); |
|
296 |
} |
|
297 |
foreach my $column (keys %$end_filter) { |
|
298 |
my $fname = $end_filter->{$column}; |
|
299 |
if (exists $end_filter->{$column} |
|
300 |
&& defined $fname |
|
301 |
&& ref $fname ne 'CODE') |
|
302 |
{ |
|
303 |
croak qq{Filter "$fname" is not registered" } . _subname |
|
304 |
unless exists $self->filters->{$fname}; |
|
305 |
$end_filter->{$column} = $self->filters->{$fname}; |
|
306 |
} |
|
307 |
} |
|
308 |
$self->{end_filter} = {%{$self->end_filter}, %$end_filter}; |
|
309 |
return $self; |
|
310 |
} |
|
311 |
return $self->{end_filter} ||= {}; |
|
312 |
} |
|
cleanup
|
313 |
# DEPRECATED! |
added experimental DBIx::Cus...
|
314 |
sub remove_end_filter { |
- added EXPERIMENTAL order m...
|
315 |
warn "remove_end_filter is DEPRECATED!"; |
added experimental DBIx::Cus...
|
316 |
my $self = shift; |
317 |
$self->{end_filter} = {}; |
|
318 |
return $self; |
|
319 |
} |
|
cleanup
|
320 |
# DEPRECATED! |
added experimental DBIx::Cus...
|
321 |
sub remove_filter { |
- added EXPERIMENTAL order m...
|
322 |
warn "remove_filter is DEPRECATED!"; |
added experimental DBIx::Cus...
|
323 |
my $self = shift; |
324 |
$self->{filter} = {}; |
|
325 |
return $self; |
|
326 |
} |
|
cleanup
|
327 |
# DEPRECATED! |
cleanup
|
328 |
sub default_filter { |
cleanup
|
329 |
warn "default_filter is DEPRECATED!"; |
- added EXPERIMENTAL order m...
|
330 |
my $self = shift; |
cleanup
|
331 |
if (@_) { |
332 |
my $fname = $_[0]; |
|
333 |
if (@_ && !$fname) { |
|
334 |
$self->{default_filter} = undef; |
|
335 |
} |
|
336 |
else { |
|
many changed
|
337 |
croak qq{Filter "$fname" is not registered} |
cleanup
|
338 |
unless exists $self->filters->{$fname}; |
339 |
$self->{default_filter} = $self->filters->{$fname}; |
|
340 |
} |
|
341 |
return $self; |
|
342 |
} |
|
343 |
return $self->{default_filter}; |
|
344 |
} |
|
cleanup
|
345 |
# DEPRECATED! |
cleanup
|
346 |
has 'filter_check'; |
cleanup
|
347 | |
update document
|
348 |
1; |
349 | ||
packaging one directory
|
350 |
=head1 NAME |
351 | ||
cleanup
|
352 |
DBIx::Custom::Result - Result of select statement |
packaging one directory
|
353 | |
update document
|
354 |
=head1 SYNOPSIS |
cleanup
|
355 | |
removed reconnect method
|
356 |
# Result |
cleanup
|
357 |
my $result = $dbi->select(table => 'book'); |
cleanup
|
358 | |
cleanup
|
359 |
# Fetch a row and put it into array reference |
removed reconnect method
|
360 |
while (my $row = $result->fetch) { |
cleanup
|
361 |
my $author = $row->[0]; |
362 |
my $title = $row->[1]; |
|
version 0.0901
|
363 |
} |
364 |
|
|
cleanup
|
365 |
# Fetch only a first row and put it into array reference |
removed reconnect method
|
366 |
my $row = $result->fetch_first; |
367 |
|
|
cleanup
|
368 |
# Fetch all rows and put them into array of array reference |
removed reconnect method
|
369 |
my $rows = $result->fetch_all; |
cleanup
|
370 | |
cleanup
|
371 |
# Fetch a row and put it into hash reference |
removed reconnect method
|
372 |
while (my $row = $result->fetch_hash) { |
cleanup
|
373 |
my $title = $row->{title}; |
374 |
my $author = $row->{author}; |
|
packaging one directory
|
375 |
} |
removed reconnect method
|
376 |
|
cleanup
|
377 |
# Fetch only a first row and put it into hash reference |
removed reconnect method
|
378 |
my $row = $result->fetch_hash_first; |
cleanup
|
379 |
my $row = $result->one; # Same as fetch_hash_first |
removed reconnect method
|
380 |
|
cleanup
|
381 |
# Fetch all rows and put them into array of hash reference |
removed reconnect method
|
382 |
my $rows = $result->fetch_hash_all; |
cleanup
|
383 |
my $rows = $result->all; # Same as fetch_hash_all |
packaging one directory
|
384 | |
update document
|
385 |
=head1 ATTRIBUTES |
packaging one directory
|
386 | |
cleanup
|
387 |
=head2 C<filters> |
388 | ||
389 |
my $filters = $result->filters; |
|
cleanup
|
390 |
$result = $result->filters(\%filters); |
cleanup
|
391 | |
cleanup
|
392 |
Filters. |
cleanup
|
393 | |
394 |
=head2 C<sth> |
|
395 | ||
396 |
my $sth = $reuslt->sth |
|
397 |
$result = $result->sth($sth); |
|
398 | ||
399 |
Statement handle of L<DBI>. |
|
400 | ||
update document
|
401 |
=head1 METHODS |
402 | ||
renamed build_query to creat...
|
403 |
L<DBIx::Custom::Result> inherits all methods from L<Object::Simple> |
cleanup
|
404 |
and implements the following new ones. |
packaging one directory
|
405 | |
updated pod
|
406 |
=head2 C<all> |
407 | ||
408 |
my $rows = $result->all; |
|
409 | ||
cleanup
|
410 |
Same as C<fetch_hash_all>. |
updated pod
|
411 | |
removed DBIx::Custom commit ...
|
412 |
=head2 C<fetch> |
packaging one directory
|
413 | |
cleanup
|
414 |
my $row = $result->fetch; |
version 0.0901
|
415 | |
cleanup
|
416 |
Fetch a row and put it into array reference. |
packaging one directory
|
417 | |
removed DBIx::Custom commit ...
|
418 |
=head2 C<fetch_all> |
packaging one directory
|
419 | |
cleanup
|
420 |
my $rows = $result->fetch_all; |
version 0.0901
|
421 | |
cleanup
|
422 |
Fetch all rows and put them into array of array reference. |
packaging one directory
|
423 | |
cleanup
|
424 |
=head2 C<fetch_first> |
425 | ||
426 |
my $row = $result->fetch_first; |
|
427 | ||
cleanup
|
428 |
Fetch only a first row and put it into array reference, |
429 |
and finish statment handle. |
|
cleanup
|
430 | |
removed DESTROY method(not b...
|
431 |
=head2 C<fetch_hash> |
packaging one directory
|
432 | |
cleanup
|
433 |
my $row = $result->fetch_hash; |
packaging one directory
|
434 | |
cleanup
|
435 |
Fetch a row and put it into hash reference. |
update document
|
436 | |
cleanup
|
437 |
=head2 C<fetch_hash_all> |
438 | ||
439 |
my $rows = $result->fetch_hash_all; |
|
440 | ||
cleanup
|
441 |
Fetch all rows and put them into array of hash reference. |
cleanup
|
442 | |
removed DBIx::Custom commit ...
|
443 |
=head2 C<fetch_hash_first> |
removed reconnect method
|
444 |
|
cleanup
|
445 |
my $row = $result->fetch_hash_first; |
packaging one directory
|
446 | |
cleanup
|
447 |
Fetch only a first row and put it into hash reference, |
448 |
and finish statment handle. |
|
packaging one directory
|
449 | |
removed DESTROY method(not b...
|
450 |
=head2 C<fetch_hash_multi> |
update document
|
451 | |
cleanup
|
452 |
my $rows = $result->fetch_hash_multi(5); |
update document
|
453 |
|
cleanup
|
454 |
Fetch multiple rows and put them into array of hash reference. |
update document
|
455 | |
cleanup
|
456 |
=head2 C<fetch_multi> |
packaging one directory
|
457 | |
cleanup
|
458 |
my $rows = $result->fetch_multi(5); |
459 |
|
|
cleanup
|
460 |
Fetch multiple rows and put them into array of array reference. |
removed DESTROY method(not b...
|
461 | |
cleanup
|
462 |
=head2 C<filter> |
463 | ||
cleanup
|
464 |
$result->filter(title => sub { uc $_[0] }, author => 'to_upper'); |
465 |
$result->filter([qw/title author/] => 'to_upper'); |
|
added experimental DBIx::Cus...
|
466 | |
cleanup
|
467 |
Set filter for column. |
468 |
You can use subroutine or filter name as filter. |
|
- DBIx::Custom Model filter ...
|
469 |
This filter is executed after C<type_rule> filter. |
cleanup
|
470 | |
- changed EXPERIMENTAL DBIx:...
|
471 |
=head2 C<filter_off> EXPERIMENTAL |
472 | ||
473 |
$result = $result->filter_off; |
|
474 | ||
475 |
Turn filtering by C<filter> method off. |
|
476 |
By default, filterin is on. |
|
477 | ||
478 |
=head2 C<filter_on> EXPERIMENTAL |
|
479 | ||
480 |
$result = $resutl->filter_on; |
|
481 | ||
482 |
Turn filtering by C<filter> method on. |
|
483 |
By default, filterin is on. |
|
484 | ||
updated pod
|
485 |
=head2 C<one> |
486 | ||
487 |
my $row = $result->one; |
|
488 | ||
cleanup
|
489 |
Same as C<fetch_hash_first>. |
added experimental DBIx::Cus...
|
490 | |
- removed DEPRECATED DBIx::C...
|
491 |
=head2 C<stash> |
added experimental DBIx::Cus...
|
492 | |
493 |
my $stash = $result->stash; |
|
494 |
my $foo = $result->stash->{foo}; |
|
495 |
$result->stash->{foo} = $foo; |
|
496 | ||
cleanup
|
497 |
Stash is hash reference for data. |
added experimental DBIx::Cus...
|
498 | |
added EXPERIMENTAL DBIx::Cus...
|
499 |
=head2 C<type_rule> EXPERIMENTAL |
cleanup
|
500 |
|
501 |
# Merge type rule |
|
added EXPERIMENTAL DBIx::Cus...
|
502 |
$result->type_rule( |
503 |
# DATE |
|
504 |
9 => sub { ... }, |
|
505 |
# DATETIME or TIMESTAMP |
|
506 |
11 => sub { ... } |
|
507 |
); |
|
508 | ||
cleanup
|
509 |
# Replace type rule(by reference) |
510 |
$result->type_rule([ |
|
511 |
# DATE |
|
512 |
9 => sub { ... }, |
|
513 |
# DATETIME or TIMESTAMP |
|
514 |
11 => sub { ... } |
|
515 |
]); |
|
EXPERIMENTAL type_rule_off i...
|
516 | |
cleanup
|
517 |
This is same as L<DBIx::Custom>'s C<type_rule>'s <from>. |
EXPERIMENTAL type_rule_off i...
|
518 | |
- changed EXPERIMENTAL DBIx:...
|
519 |
=head2 C<type_rule_off> EXPERIMENTAL |
520 | ||
521 |
$result = $result->type_rule_off; |
|
522 | ||
523 |
Turn C<from1> and C<from2> type rule off. |
|
524 |
By default, type rule is on. |
|
525 | ||
526 |
=head2 C<type_rule_on> EXPERIMENTAL |
|
527 | ||
528 |
$result = $result->type_rule_on; |
|
529 | ||
530 |
Turn C<from1> and C<from2> type rule on. |
|
531 |
By default, type rule is on. |
|
532 | ||
533 |
=head2 C<type_rule1_off> EXPERIMENTAL |
|
534 | ||
535 |
$result = $result->type_rule1_off; |
|
536 | ||
537 |
Turn C<from1> type rule off. |
|
538 |
By default, type rule is on. |
|
539 | ||
540 |
=head2 C<type_rule1_on> EXPERIMENTAL |
|
541 | ||
542 |
$result = $result->type_rule1_on; |
|
543 | ||
544 |
Turn C<from1> type rule on. |
|
545 |
By default, type rule is on. |
|
546 | ||
547 |
=head2 C<type_rule2_off> EXPERIMENTAL |
|
548 | ||
549 |
$result = $result->type_rule2_off; |
|
550 | ||
551 |
Turn C<from2> type rule off. |
|
552 |
By default, type rule is on. |
|
553 | ||
554 |
=head2 C<type_rule2_on> EXPERIMENTAL |
|
555 | ||
556 |
$result = $result->type_rule2_on; |
|
557 | ||
558 |
Turn C<from2> type rule on. |
|
559 |
By default, type rule is on. |
|
560 | ||
packaging one directory
|
561 |
=cut |