Newer Older
483 lines | 9.917kb
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';
cleanup
Yuki Kimoto authored on 2011-04-25
9
use DBIx::Custom::Util qw/_array_to_hash _subname/;
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

            
- added DBIx::Custom::Result...
Yuki Kimoto authored on 2011-06-07
16
*all = \&fetch_hash_all;
17

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

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

            
55
sub end_filter {
56
    my $self = shift;
57
    
58
    if (@_) {
all filter can receive array...
Yuki Kimoto authored on 2011-02-25
59
        my $end_filter = {};
60
        
61
        if (ref $_[0] eq 'HASH') {
62
            $end_filter = $_[0];
63
        }
64
        else {
cleanup
Yuki Kimoto authored on 2011-04-25
65
            $end_filter = _array_to_hash(
all filter can receive array...
Yuki Kimoto authored on 2011-02-25
66
                @_ > 1 ? [@_] : $_[0]
67
            );
68
        }
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-17
69
        
70
        foreach my $column (keys %$end_filter) {
71
            my $fname = $end_filter->{$column};
fix bug : filter can't over...
Yuki Kimoto authored on 2011-02-09
72
            
73
            if  (exists $end_filter->{$column}
74
              && defined $fname
75
              && ref $fname ne 'CODE') 
76
            {
cleanup
Yuki Kimoto authored on 2011-04-25
77
              croak qq{Filter "$fname" is not registered" } . _subname
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
cleanup
Yuki Kimoto authored on 2011-04-25
218
    croak 'Row count must be specified ' . _subname
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
cleanup
Yuki Kimoto authored on 2011-04-25
237
    croak 'Row count must be specified ' . _subname
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 DBIx::Custom::Result...
Yuki Kimoto authored on 2011-06-07
252
*one = \&fetch_hash_first;
253

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

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

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

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

            
update document
yuki-kimoto authored on 2010-01-30
295
1;
296

            
packaging one directory
yuki-kimoto authored on 2009-11-16
297
=head1 NAME
298

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

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

            
303
Get the result of select statement.
304

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

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

            
332
Fetch row into hash.
333

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

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

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

            
cleanup
yuki-kimoto authored on 2010-10-17
360
=head2 C<filters>
361

            
362
    my $filters = $result->filters;
363
    $result     = $result->filters(\%filters);
364

            
365
Resistered filters.
366

            
367
=head2 C<sth>
368

            
369
    my $sth = $reuslt->sth
370
    $result = $result->sth($sth);
371

            
372
Statement handle of L<DBI>.
373

            
update document
yuki-kimoto authored on 2010-01-30
374
=head1 METHODS
375

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

            
updated pod
Yuki Kimoto authored on 2011-06-07
379
=head2 C<all>
380

            
381
    my $rows = $result->all;
382

            
383
This is alias for C<fetch_hash_all>.
384

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

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

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

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

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

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

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

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

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

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

            
cleanup
yuki-kimoto authored on 2010-10-17
408
=head2 C<fetch_first>
409

            
410
    my $row = $result->fetch_first;
411

            
412
Fetch only a first row into array and finish statment handle.
413

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

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

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

            
cleanup
yuki-kimoto authored on 2010-10-17
420
=head2 C<fetch_hash_all>
421

            
422
    my $rows = $result->fetch_hash_all;
423

            
424
Fetch all rows into array of hash.
425

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

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

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

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

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

            
cleanup
yuki-kimoto authored on 2010-10-17
441
    my $rows = $result->fetch_multi(5);
442
    
443
Fetch multiple rows into array of array.
444
Row count must be specified.
removed DESTROY method(not b...
yuki-kimoto authored on 2010-07-18
445

            
cleanup
Yuki Kimoto authored on 2010-12-21
446
=head2 C<filter>
447

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

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

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

            
updated pod
Yuki Kimoto authored on 2011-06-07
457
=head2 C<one>
458

            
459
    my $row = $result->one;
460

            
461
This is alias for C<fetch_hash_first>.
462

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

            
465
    $result->remove_end_filter;
466

            
467
Remove end filter.
468

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

            
471
    $result->remove_filter;
472

            
473
Remove filter. End filter is not removed.
474

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

            
477
    my $stash = $result->stash;
478
    my $foo = $result->stash->{foo};
479
    $result->stash->{foo} = $foo;
480

            
481
Stash is hash reference to save your data.
482

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