Newer Older
469 lines | 9.851kb
packaging one directory
yuki-kimoto authored on 2009-11-16
1
package DBIx::Custom::Result;
update document
yuki-kimoto authored on 2009-11-17
2

            
packaging one directory
yuki-kimoto authored on 2009-11-16
3
use strict;
4
use warnings;
update document
yuki-kimoto authored on 2010-01-30
5

            
6
use base 'Object::Simple';
cleanup
yuki-kimoto authored on 2010-02-11
7

            
packaging one directory
yuki-kimoto authored on 2009-11-16
8
use Carp 'croak';
all filter can receive array...
Yuki Kimoto authored on 2011-02-25
9
use DBIx::Custom::Util;
packaging one directory
yuki-kimoto authored on 2009-11-16
10

            
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-25
11
__PACKAGE__->attr(
12
    [qw/filters sth/],
13
    stash => sub { {} }
14
);
cleanup
Yuki Kimoto authored on 2010-12-21
15

            
16
sub filter {
17
    my $self = shift;
cleanup
Yuki Kimoto authored on 2010-12-22
18
    
19
    if (@_) {
all filter can receive array...
Yuki Kimoto authored on 2011-02-25
20
        my $filter = {};
cleanup
Yuki Kimoto authored on 2010-12-22
21
        
all filter can receive array...
Yuki Kimoto authored on 2011-02-25
22
        if (ref $_[0] eq 'HASH') {
23
            $filter = $_[0];
24
        }
25
        else {
cleanup
Yuki Kimoto authored on 2011-03-21
26
            $filter = DBIx::Custom::Util::array_to_hash(
all filter can receive array...
Yuki Kimoto authored on 2011-02-25
27
                @_ > 1 ? [@_] : $_[0]
28
            );
29
        }
30
                
cleanup
Yuki Kimoto authored on 2010-12-22
31
        foreach my $column (keys %$filter) {
32
            my $fname = $filter->{$column};
fix bug : filter can't over...
Yuki Kimoto authored on 2011-02-09
33

            
34
            if  (exists $filter->{$column}
35
              && defined $fname
36
              && ref $fname ne 'CODE') 
37
            {
many changed
Yuki Kimoto authored on 2011-01-23
38
              croak qq{Filter "$fname" is not registered"}
improved error messages
Yuki Kimoto authored on 2011-04-18
39
                  . qq{ (DBIx::Custom::Result::filter)}
cleanup
Yuki Kimoto authored on 2010-12-22
40
                unless exists $self->filters->{$fname};
41
              
42
              $filter->{$column} = $self->filters->{$fname};
43
            }
cleanup
Yuki Kimoto authored on 2010-12-21
44
        }
cleanup
Yuki Kimoto authored on 2010-12-22
45
        
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-17
46
        $self->{filter} = {%{$self->filter}, %$filter};
cleanup
Yuki Kimoto authored on 2010-12-22
47
        
48
        return $self;
cleanup
Yuki Kimoto authored on 2010-12-21
49
    }
50
    
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-17
51
    return $self->{filter} ||= {};
52
}
53

            
54
sub end_filter {
55
    my $self = shift;
56
    
57
    if (@_) {
all filter can receive array...
Yuki Kimoto authored on 2011-02-25
58
        my $end_filter = {};
59
        
60
        if (ref $_[0] eq 'HASH') {
61
            $end_filter = $_[0];
62
        }
63
        else {
cleanup
Yuki Kimoto authored on 2011-03-21
64
            $end_filter = DBIx::Custom::Util::array_to_hash(
all filter can receive array...
Yuki Kimoto authored on 2011-02-25
65
                @_ > 1 ? [@_] : $_[0]
66
            );
67
        }
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-17
68
        
69
        foreach my $column (keys %$end_filter) {
70
            my $fname = $end_filter->{$column};
fix bug : filter can't over...
Yuki Kimoto authored on 2011-02-09
71
            
72
            if  (exists $end_filter->{$column}
73
              && defined $fname
74
              && ref $fname ne 'CODE') 
75
            {
many changed
Yuki Kimoto authored on 2011-01-23
76
              croak qq{Filter "$fname" is not registered"}
improved error messages
Yuki Kimoto authored on 2011-04-18
77
                  . qq{ (DBIx::Custom::Result::end_filter)}
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-17
78
                unless exists $self->filters->{$fname};
79
              
80
              $end_filter->{$column} = $self->filters->{$fname};
81
            }
82
        }
83
        
84
        $self->{end_filter} = {%{$self->end_filter}, %$end_filter};
85
        
86
        return $self;
87
    }
88
    
89
    return $self->{end_filter} ||= {};
cleanup
Yuki Kimoto authored on 2010-12-21
90
}
cleanup
yuki-kimoto authored on 2010-01-21
91

            
packaging one directory
yuki-kimoto authored on 2009-11-16
92
sub fetch {
changed argument of tag proc...
yuki-kimoto authored on 2010-08-03
93
    my $self = shift;
94
    
cleanup
Yuki Kimoto authored on 2011-01-12
95
    # Filter
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-17
96
    my $filter = $self->filter;
97
    
98
    # End filter
99
    my $end_filter = $self->end_filter;
packaging one directory
yuki-kimoto authored on 2009-11-16
100
    
101
    # Fetch
changed argument of tag proc...
yuki-kimoto authored on 2010-08-03
102
    my @row = $self->{sth}->fetchrow_array;
packaging one directory
yuki-kimoto authored on 2009-11-16
103
    
cleanup
yuki-kimoto authored on 2010-08-05
104
    # No row
update document
yuki-kimoto authored on 2010-05-27
105
    return unless @row;
added check_filter attribute
yuki-kimoto authored on 2010-08-08
106
    
cleanup
yuki-kimoto authored on 2010-08-05
107
    # Filtering
added experimental iterate_a...
Yuki Kimoto authored on 2010-12-22
108
    my $columns = $self->{sth}->{NAME};
cleanup
yuki-kimoto authored on 2010-08-05
109
    for (my $i = 0; $i < @$columns; $i++) {
update document
yuki-kimoto authored on 2010-05-27
110
        
changed argument of tag proc...
yuki-kimoto authored on 2010-08-03
111
        # Filter name
cleanup
yuki-kimoto authored on 2010-08-05
112
        my $column = $columns->[$i];
cleanup
Yuki Kimoto authored on 2010-12-21
113
        my $f  = exists $filter->{$column}
114
               ? $filter->{$column}
cleanup
Yuki Kimoto authored on 2010-12-22
115
               : $self->default_filter;
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-17
116
        my $ef = $end_filter->{$column};
some changed
yuki-kimoto authored on 2010-05-02
117
        
cleanup
yuki-kimoto authored on 2010-08-05
118
        # Filtering
cleanup
Yuki Kimoto authored on 2010-12-21
119
        $row[$i] = $f->($row[$i]) if $f;
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-17
120
        $row[$i] = $ef->($row[$i]) if $ef;
packaging one directory
yuki-kimoto authored on 2009-11-16
121
    }
many many changes
yuki-kimoto authored on 2010-04-30
122

            
removed reconnect method
yuki-kimoto authored on 2010-05-28
123
    return \@row;
124
}
125

            
cleanup
yuki-kimoto authored on 2010-10-17
126
sub fetch_all {
127
    my $self = shift;
128
    
129
    # Fetch all rows
130
    my $rows = [];
131
    while(my $row = $self->fetch) {
132
        push @$rows, $row;
133
    }
134
    return $rows;
135
}
136

            
removed reconnect method
yuki-kimoto authored on 2010-05-28
137
sub fetch_first {
138
    my $self = shift;
139
    
140
    # Fetch
141
    my $row = $self->fetch;
142
    
cleanup
yuki-kimoto authored on 2010-08-05
143
    # No row
removed reconnect method
yuki-kimoto authored on 2010-05-28
144
    return unless $row;
145
    
146
    # Finish statement handle
147
    $self->sth->finish;
148
    
149
    return $row;
150
}
151

            
packaging one directory
yuki-kimoto authored on 2009-11-16
152
sub fetch_hash {
changed argument of tag proc...
yuki-kimoto authored on 2010-08-03
153
    my $self = shift;
154
    
cleanup
Yuki Kimoto authored on 2011-01-12
155
    # Filter
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-17
156
    my $filter  = $self->filter;
157
    
158
    # End filter
159
    my $end_filter = $self->end_filter;
packaging one directory
yuki-kimoto authored on 2009-11-16
160
    
161
    # Fetch
changed argument of tag proc...
yuki-kimoto authored on 2010-08-03
162
    my $row = $self->{sth}->fetchrow_arrayref;
packaging one directory
yuki-kimoto authored on 2009-11-16
163
    
164
    # Cannot fetch
165
    return unless $row;
added check_filter attribute
yuki-kimoto authored on 2010-08-08
166

            
packaging one directory
yuki-kimoto authored on 2009-11-16
167
    # Filter
168
    my $row_hash = {};
added experimental iterate_a...
Yuki Kimoto authored on 2010-12-22
169
    my $columns = $self->{sth}->{NAME};
cleanup
yuki-kimoto authored on 2010-08-05
170
    for (my $i = 0; $i < @$columns; $i++) {
update document
yuki-kimoto authored on 2010-05-27
171
        
changed argument of tag proc...
yuki-kimoto authored on 2010-08-03
172
        # Filter name
cleanup
yuki-kimoto authored on 2010-08-05
173
        my $column = $columns->[$i];
cleanup
Yuki Kimoto authored on 2010-12-21
174
        my $f  = exists $filter->{$column}
175
               ? $filter->{$column}
cleanup
Yuki Kimoto authored on 2010-12-22
176
               : $self->default_filter;
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-17
177
        my $ef = $end_filter->{$column};
add query filter error check
yuki-kimoto authored on 2010-05-14
178
        
cleanup
yuki-kimoto authored on 2010-08-05
179
        # Filtering
cleanup
Yuki Kimoto authored on 2010-12-21
180
        $row_hash->{$column} = $f ? $f->($row->[$i]) : $row->[$i];
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-17
181
        $row_hash->{$column} = $ef->($row_hash->{$column}) if $ef;
packaging one directory
yuki-kimoto authored on 2009-11-16
182
    }
183
    
removed reconnect method
yuki-kimoto authored on 2010-05-28
184
    return $row_hash;
packaging one directory
yuki-kimoto authored on 2009-11-16
185
}
186

            
cleanup
yuki-kimoto authored on 2010-10-17
187
sub fetch_hash_all {
188
    my $self = shift;
189
    
190
    # Fetch all rows as hash
191
    my $rows = [];
192
    while(my $row = $self->fetch_hash) {
193
        push @$rows, $row;
194
    }
195
    
196
    return $rows;
197
}
198

            
removed reconnect method
yuki-kimoto authored on 2010-05-28
199
sub fetch_hash_first {
packaging one directory
yuki-kimoto authored on 2009-11-16
200
    my $self = shift;
201
    
202
    # Fetch hash
203
    my $row = $self->fetch_hash;
204
    
cleanup
yuki-kimoto authored on 2010-08-05
205
    # No row
packaging one directory
yuki-kimoto authored on 2009-11-16
206
    return unless $row;
207
    
208
    # Finish statement handle
some changed
yuki-kimoto authored on 2010-05-02
209
    $self->sth->finish;
packaging one directory
yuki-kimoto authored on 2009-11-16
210
    
removed reconnect method
yuki-kimoto authored on 2010-05-28
211
    return $row;
packaging one directory
yuki-kimoto authored on 2009-11-16
212
}
213

            
renamed fetch_rows to fetch_...
yuki-kimoto authored on 2010-05-01
214
sub fetch_hash_multi {
packaging one directory
yuki-kimoto authored on 2009-11-16
215
    my ($self, $count) = @_;
216
    
cleanup
yuki-kimoto authored on 2010-08-05
217
    # Row count not specified
improved error messages
Yuki Kimoto authored on 2011-04-18
218
    croak 'Row count must be specified (DBIx::Custom::Result::fetch_hash_multi)'
packaging one directory
yuki-kimoto authored on 2009-11-16
219
      unless $count;
220
    
221
    # Fetch multi rows
222
    my $rows = [];
223
    for (my $i = 0; $i < $count; $i++) {
removed reconnect method
yuki-kimoto authored on 2010-05-28
224
        my $row = $self->fetch_hash;
225
        last unless $row;
226
        push @$rows, $row;
packaging one directory
yuki-kimoto authored on 2009-11-16
227
    }
228
    
229
    return unless @$rows;
removed reconnect method
yuki-kimoto authored on 2010-05-28
230
    return $rows;
packaging one directory
yuki-kimoto authored on 2009-11-16
231
}
232

            
cleanup
yuki-kimoto authored on 2010-10-17
233
sub fetch_multi {
234
    my ($self, $count) = @_;
packaging one directory
yuki-kimoto authored on 2009-11-16
235
    
cleanup
yuki-kimoto authored on 2010-10-17
236
    # Row count not specifed
improved error messages
Yuki Kimoto authored on 2011-04-18
237
    croak 'Row count must be specified (DBIx::Custom::Result::fetch_multi)'
cleanup
yuki-kimoto authored on 2010-10-17
238
      unless $count;
239
    
240
    # Fetch multi rows
packaging one directory
yuki-kimoto authored on 2009-11-16
241
    my $rows = [];
cleanup
yuki-kimoto authored on 2010-10-17
242
    for (my $i = 0; $i < $count; $i++) {
243
        my $row = $self->fetch;
244
        last unless $row;
removed reconnect method
yuki-kimoto authored on 2010-05-28
245
        push @$rows, $row;
packaging one directory
yuki-kimoto authored on 2009-11-16
246
    }
changed argument of tag proc...
yuki-kimoto authored on 2010-08-03
247
    
cleanup
yuki-kimoto authored on 2010-10-17
248
    return unless @$rows;
removed reconnect method
yuki-kimoto authored on 2010-05-28
249
    return $rows;
packaging one directory
yuki-kimoto authored on 2009-11-16
250
}
251

            
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-02-28
252
sub remove_end_filter {
253
    my $self = shift;
254
    
255
    $self->{end_filter} = {};
256
    
257
    return $self;
258
}
259

            
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-02-28
260
sub remove_filter {
261
    my $self = shift;
262
    
263
    $self->{filter} = {};
264
    
265
    return $self;
266
}
267

            
cleanup
Yuki Kimoto authored on 2011-01-12
268
# Deprecated
269
sub default_filter {
270
    my $self = shift;
271
    
272
    if (@_) {
273
        my $fname = $_[0];
274
        if (@_ && !$fname) {
275
            $self->{default_filter} = undef;
276
        }
277
        else {
many changed
Yuki Kimoto authored on 2011-01-23
278
            croak qq{Filter "$fname" is not registered}
cleanup
Yuki Kimoto authored on 2011-01-12
279
              unless exists $self->filters->{$fname};
280
        
281
            $self->{default_filter} = $self->filters->{$fname};
282
        }
283
        
284
        return $self;
285
    }
286
    
287
    return $self->{default_filter};
288
}
289

            
cleanup
Yuki Kimoto authored on 2011-01-23
290
# DEPRECATED!
291
__PACKAGE__->attr('filter_check'); 
292

            
update document
yuki-kimoto authored on 2010-01-30
293
1;
294

            
packaging one directory
yuki-kimoto authored on 2009-11-16
295
=head1 NAME
296

            
cleanup
yuki-kimoto authored on 2010-08-05
297
DBIx::Custom::Result - Result of select statement
packaging one directory
yuki-kimoto authored on 2009-11-16
298

            
update document
yuki-kimoto authored on 2010-01-30
299
=head1 SYNOPSIS
cleanup
yuki-kimoto authored on 2010-08-05
300

            
301
Get the result of select statement.
302

            
removed reconnect method
yuki-kimoto authored on 2010-05-28
303
    # Result
304
    my $result = $dbi->select(table => 'books');
cleanup
yuki-kimoto authored on 2010-08-05
305

            
306
Fetch row into array.
removed reconnect method
yuki-kimoto authored on 2010-05-28
307
    
308
    # Fetch a row into array
309
    while (my $row = $result->fetch) {
cleanup
yuki-kimoto authored on 2010-08-05
310
        my $author = $row->[0];
311
        my $title  = $row->[1];
removed reconnect method
yuki-kimoto authored on 2010-05-28
312
        
version 0.0901
yuki-kimoto authored on 2009-12-17
313
    }
314
    
cleanup
yuki-kimoto authored on 2010-08-05
315
    # Fetch only a first row into array
removed reconnect method
yuki-kimoto authored on 2010-05-28
316
    my $row = $result->fetch_first;
317
    
318
    # Fetch multiple rows into array of array
319
    while (my $rows = $result->fetch_multi(5)) {
cleanup
yuki-kimoto authored on 2010-08-05
320
        my $first_author  = $rows->[0][0];
321
        my $first_title   = $rows->[0][1];
322
        my $second_author = $rows->[1][0];
323
        my $second_value  = $rows->[1][1];
324
    
removed reconnect method
yuki-kimoto authored on 2010-05-28
325
    }
326
    
327
    # Fetch all rows into array of array
328
    my $rows = $result->fetch_all;
cleanup
yuki-kimoto authored on 2010-08-05
329

            
330
Fetch row into hash.
331

            
332
    # Fetch a row into hash
removed reconnect method
yuki-kimoto authored on 2010-05-28
333
    while (my $row = $result->fetch_hash) {
cleanup
yuki-kimoto authored on 2010-08-05
334
        my $title  = $row->{title};
335
        my $author = $row->{author};
removed reconnect method
yuki-kimoto authored on 2010-05-28
336
        
packaging one directory
yuki-kimoto authored on 2009-11-16
337
    }
removed reconnect method
yuki-kimoto authored on 2010-05-28
338
    
cleanup
yuki-kimoto authored on 2010-08-05
339
    # Fetch only a first row into hash
removed reconnect method
yuki-kimoto authored on 2010-05-28
340
    my $row = $result->fetch_hash_first;
341
    
342
    # Fetch multiple rows into array of hash
cleanup
yuki-kimoto authored on 2010-08-05
343
    while (my $rows = $result->fetch_hash_multi(5)) {
344
        my $first_title   = $rows->[0]{title};
345
        my $first_author  = $rows->[0]{author};
346
        my $second_title  = $rows->[1]{title};
347
        my $second_author = $rows->[1]{author};
removed reconnect method
yuki-kimoto authored on 2010-05-28
348
    }
349
    
350
    # Fetch all rows into array of hash
351
    my $rows = $result->fetch_hash_all;
packaging one directory
yuki-kimoto authored on 2009-11-16
352

            
update document
yuki-kimoto authored on 2010-01-30
353
=head1 ATTRIBUTES
packaging one directory
yuki-kimoto authored on 2009-11-16
354

            
cleanup
yuki-kimoto authored on 2010-08-05
355
Filters when a row is fetched.
356
This overwrites C<default_filter>.
removed DESTROY method(not b...
yuki-kimoto authored on 2010-07-18
357

            
cleanup
yuki-kimoto authored on 2010-10-17
358
=head2 C<filters>
359

            
360
    my $filters = $result->filters;
361
    $result     = $result->filters(\%filters);
362

            
363
Resistered filters.
364

            
365
=head2 C<sth>
366

            
367
    my $sth = $reuslt->sth
368
    $result = $result->sth($sth);
369

            
370
Statement handle of L<DBI>.
371

            
update document
yuki-kimoto authored on 2010-01-30
372
=head1 METHODS
373

            
renamed build_query to creat...
yuki-kimoto authored on 2010-08-06
374
L<DBIx::Custom::Result> inherits all methods from L<Object::Simple>
cleanup
yuki-kimoto authored on 2010-08-05
375
and implements the following new ones.
packaging one directory
yuki-kimoto authored on 2009-11-16
376

            
- removed DEPRECATED DBIx::C...
Yuki Kimoto authored on 2011-04-11
377
=head2 C<end_filter>
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-17
378

            
all filter can receive array...
Yuki Kimoto authored on 2011-02-25
379
    $result = $result->end_filter(title  => 'to_something',
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-25
380
                                     author => 'to_something');
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-17
381

            
all filter can receive array...
Yuki Kimoto authored on 2011-02-25
382
    $result = $result->end_filter([qw/title author/] => 'to_something');
383

            
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-17
384
End filters.
385
These each filters is executed after the filters applied by C<apply_filter> of
386
L<DBIx::Custom> or C<filter> method.
387

            
removed DBIx::Custom commit ...
yuki-kimoto authored on 2010-07-14
388
=head2 C<fetch>
packaging one directory
yuki-kimoto authored on 2009-11-16
389

            
cleanup
yuki-kimoto authored on 2010-08-05
390
    my $row = $result->fetch;
version 0.0901
yuki-kimoto authored on 2009-12-17
391

            
cleanup
yuki-kimoto authored on 2010-08-05
392
Fetch a row into array.
packaging one directory
yuki-kimoto authored on 2009-11-16
393

            
removed DBIx::Custom commit ...
yuki-kimoto authored on 2010-07-14
394
=head2 C<fetch_all>
packaging one directory
yuki-kimoto authored on 2009-11-16
395

            
cleanup
yuki-kimoto authored on 2010-08-05
396
    my $rows = $result->fetch_all;
version 0.0901
yuki-kimoto authored on 2009-12-17
397

            
removed DESTROY method(not b...
yuki-kimoto authored on 2010-07-18
398
Fetch all rows into array of array.
packaging one directory
yuki-kimoto authored on 2009-11-16
399

            
cleanup
yuki-kimoto authored on 2010-10-17
400
=head2 C<fetch_first>
401

            
402
    my $row = $result->fetch_first;
403

            
404
Fetch only a first row into array and finish statment handle.
405

            
removed DESTROY method(not b...
yuki-kimoto authored on 2010-07-18
406
=head2 C<fetch_hash>
packaging one directory
yuki-kimoto authored on 2009-11-16
407

            
cleanup
yuki-kimoto authored on 2010-08-05
408
    my $row = $result->fetch_hash;
packaging one directory
yuki-kimoto authored on 2009-11-16
409

            
removed DESTROY method(not b...
yuki-kimoto authored on 2010-07-18
410
Fetch a row into hash
update document
yuki-kimoto authored on 2009-11-19
411

            
cleanup
yuki-kimoto authored on 2010-10-17
412
=head2 C<fetch_hash_all>
413

            
414
    my $rows = $result->fetch_hash_all;
415

            
416
Fetch all rows into array of hash.
417

            
removed DBIx::Custom commit ...
yuki-kimoto authored on 2010-07-14
418
=head2 C<fetch_hash_first>
removed reconnect method
yuki-kimoto authored on 2010-05-28
419
    
cleanup
yuki-kimoto authored on 2010-08-05
420
    my $row = $result->fetch_hash_first;
packaging one directory
yuki-kimoto authored on 2009-11-16
421

            
removed DESTROY method(not b...
yuki-kimoto authored on 2010-07-18
422
Fetch only first row into hash and finish statment handle.
packaging one directory
yuki-kimoto authored on 2009-11-16
423

            
removed DESTROY method(not b...
yuki-kimoto authored on 2010-07-18
424
=head2 C<fetch_hash_multi>
update document
yuki-kimoto authored on 2009-11-19
425

            
cleanup
yuki-kimoto authored on 2010-08-05
426
    my $rows = $result->fetch_hash_multi(5);
update document
yuki-kimoto authored on 2009-11-19
427
    
removed DESTROY method(not b...
yuki-kimoto authored on 2010-07-18
428
Fetch multiple rows into array of hash
cleanup
yuki-kimoto authored on 2010-08-05
429
Row count must be specified.
update document
yuki-kimoto authored on 2009-11-19
430

            
cleanup
yuki-kimoto authored on 2010-10-17
431
=head2 C<fetch_multi>
packaging one directory
yuki-kimoto authored on 2009-11-16
432

            
cleanup
yuki-kimoto authored on 2010-10-17
433
    my $rows = $result->fetch_multi(5);
434
    
435
Fetch multiple rows into array of array.
436
Row count must be specified.
removed DESTROY method(not b...
yuki-kimoto authored on 2010-07-18
437

            
cleanup
Yuki Kimoto authored on 2010-12-21
438
=head2 C<filter>
439

            
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-25
440
    $result = $result->filter(title  => 'to_something',
441
                              author => 'to_something');
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-17
442

            
all filter can receive array...
Yuki Kimoto authored on 2011-02-25
443
    $result = $result->filter([qw/title author/] => 'to_something');
444

            
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-17
445
Filters.
446
These each filters override the filters applied by C<apply_filter> of
447
L<DBIx::Custom>.
cleanup
Yuki Kimoto authored on 2010-12-21
448

            
- removed DEPRECATED DBIx::C...
Yuki Kimoto authored on 2011-04-11
449
=head2 C<remove_end_filter>
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-02-28
450

            
451
    $result->remove_end_filter;
452

            
453
Remove end filter.
454

            
- removed DEPRECATED DBIx::C...
Yuki Kimoto authored on 2011-04-11
455
=head2 C<remove_filter>
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-02-28
456

            
457
    $result->remove_filter;
458

            
459
Remove filter. End filter is not removed.
460

            
- removed DEPRECATED DBIx::C...
Yuki Kimoto authored on 2011-04-11
461
=head2 C<stash>
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-25
462

            
463
    my $stash = $result->stash;
464
    my $foo = $result->stash->{foo};
465
    $result->stash->{foo} = $foo;
466

            
467
Stash is hash reference to save your data.
468

            
packaging one directory
yuki-kimoto authored on 2009-11-16
469
=cut