Newer Older
521 lines | 11.188kb
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

            
updatedd pod
Yuki Kimoto authored on 2011-06-12
3
use Object::Simple -base;
cleanup
yuki-kimoto authored on 2010-02-11
4

            
packaging one directory
yuki-kimoto authored on 2009-11-16
5
use Carp 'croak';
cleanup
Yuki Kimoto authored on 2011-04-25
6
use DBIx::Custom::Util qw/_array_to_hash _subname/;
packaging one directory
yuki-kimoto authored on 2009-11-16
7

            
updatedd pod
Yuki Kimoto authored on 2011-06-12
8
has [qw/filters filter_off sth type_rule type_rule_off/],
9
    stash => sub { {} };
cleanup
Yuki Kimoto authored on 2010-12-21
10

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

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

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

            
packaging one directory
yuki-kimoto authored on 2009-11-16
50
sub fetch {
changed argument of tag proc...
yuki-kimoto authored on 2010-08-03
51
    my $self = shift;
52
    
cleanup
Yuki Kimoto authored on 2011-01-12
53
    # Filter
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-17
54
    my $filter = $self->filter;
55
    
56
    # End filter
cleanup
Yuki Kimoto authored on 2011-06-13
57
    my $end_filter = $self->{end_filter} || {};
packaging one directory
yuki-kimoto authored on 2009-11-16
58
    
59
    # Fetch
changed argument of tag proc...
yuki-kimoto authored on 2010-08-03
60
    my @row = $self->{sth}->fetchrow_array;
packaging one directory
yuki-kimoto authored on 2009-11-16
61
    
cleanup
yuki-kimoto authored on 2010-08-05
62
    # No row
update document
yuki-kimoto authored on 2010-05-27
63
    return unless @row;
added check_filter attribute
yuki-kimoto authored on 2010-08-08
64
    
cleanup
yuki-kimoto authored on 2010-08-05
65
    # Filtering
added experimental iterate_a...
Yuki Kimoto authored on 2010-12-22
66
    my $columns = $self->{sth}->{NAME};
added type_rule method and f...
Yuki Kimoto authored on 2011-06-09
67
    my $types = $self->{sth}->{TYPE};
68
    my $type_rule = $self->type_rule || {};
69
    
cleanup
yuki-kimoto authored on 2010-08-05
70
    for (my $i = 0; $i < @$columns; $i++) {
update document
yuki-kimoto authored on 2010-05-27
71
        
changed type_rule arguments ...
Yuki Kimoto authored on 2011-06-12
72
        if (!$self->type_rule_off && $type_rule->{from} &&
73
            (my $rule = $type_rule->{from}->{$types->[$i]}))
added type_rule method and f...
Yuki Kimoto authored on 2011-06-09
74
        {
75
            $row[$i] = $rule->($row[$i]);
76
        }
77
        
changed argument of tag proc...
yuki-kimoto authored on 2010-08-03
78
        # Filter name
cleanup
yuki-kimoto authored on 2010-08-05
79
        my $column = $columns->[$i];
cleanup
Yuki Kimoto authored on 2010-12-21
80
        my $f  = exists $filter->{$column}
81
               ? $filter->{$column}
cleanup
Yuki Kimoto authored on 2011-06-13
82
               : $self->{default_filter};
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-17
83
        my $ef = $end_filter->{$column};
some changed
yuki-kimoto authored on 2010-05-02
84
        
cleanup
yuki-kimoto authored on 2010-08-05
85
        # Filtering
type_rule can receive filter...
Yuki Kimoto authored on 2011-06-12
86
        $row[$i] = $f->($row[$i]) if $f && !$self->filter_off;
87
        $row[$i] = $ef->($row[$i]) if $ef && !$self->filter_off;
packaging one directory
yuki-kimoto authored on 2009-11-16
88
    }
many many changes
yuki-kimoto authored on 2010-04-30
89

            
removed reconnect method
yuki-kimoto authored on 2010-05-28
90
    return \@row;
91
}
92

            
cleanup
yuki-kimoto authored on 2010-10-17
93
sub fetch_all {
94
    my $self = shift;
95
    
96
    # Fetch all rows
97
    my $rows = [];
98
    while(my $row = $self->fetch) {
99
        push @$rows, $row;
100
    }
101
    return $rows;
102
}
103

            
removed reconnect method
yuki-kimoto authored on 2010-05-28
104
sub fetch_first {
105
    my $self = shift;
106
    
107
    # Fetch
108
    my $row = $self->fetch;
109
    
cleanup
yuki-kimoto authored on 2010-08-05
110
    # No row
removed reconnect method
yuki-kimoto authored on 2010-05-28
111
    return unless $row;
112
    
113
    # Finish statement handle
114
    $self->sth->finish;
115
    
116
    return $row;
117
}
118

            
packaging one directory
yuki-kimoto authored on 2009-11-16
119
sub fetch_hash {
changed argument of tag proc...
yuki-kimoto authored on 2010-08-03
120
    my $self = shift;
121
    
cleanup
Yuki Kimoto authored on 2011-01-12
122
    # Filter
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-17
123
    my $filter  = $self->filter;
124
    
125
    # End filter
cleanup
Yuki Kimoto authored on 2011-06-13
126
    my $end_filter = $self->{end_filter} || {};
packaging one directory
yuki-kimoto authored on 2009-11-16
127
    
128
    # Fetch
changed argument of tag proc...
yuki-kimoto authored on 2010-08-03
129
    my $row = $self->{sth}->fetchrow_arrayref;
packaging one directory
yuki-kimoto authored on 2009-11-16
130
    
131
    # Cannot fetch
132
    return unless $row;
added check_filter attribute
yuki-kimoto authored on 2010-08-08
133

            
packaging one directory
yuki-kimoto authored on 2009-11-16
134
    # Filter
135
    my $row_hash = {};
added experimental iterate_a...
Yuki Kimoto authored on 2010-12-22
136
    my $columns = $self->{sth}->{NAME};
added type_rule method and f...
Yuki Kimoto authored on 2011-06-09
137
    my $types = $self->{sth}->{TYPE};
138
    my $type_rule = $self->type_rule || {};
cleanup
yuki-kimoto authored on 2010-08-05
139
    for (my $i = 0; $i < @$columns; $i++) {
update document
yuki-kimoto authored on 2010-05-27
140
        
added type_rule method and f...
Yuki Kimoto authored on 2011-06-09
141
        # Type rule
changed type_rule arguments ...
Yuki Kimoto authored on 2011-06-12
142
        if (!$self->type_rule_off && $type_rule->{from} &&
143
            (my $rule = $type_rule->{from}->{$types->[$i]}))
added type_rule method and f...
Yuki Kimoto authored on 2011-06-09
144
        {
145
            $row->[$i] = $rule->($row->[$i]);
146
        }
147
        
changed argument of tag proc...
yuki-kimoto authored on 2010-08-03
148
        # Filter name
cleanup
yuki-kimoto authored on 2010-08-05
149
        my $column = $columns->[$i];
cleanup
Yuki Kimoto authored on 2010-12-21
150
        my $f  = exists $filter->{$column}
151
               ? $filter->{$column}
cleanup
Yuki Kimoto authored on 2011-06-13
152
               : $self->{default_filter};
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-17
153
        my $ef = $end_filter->{$column};
add query filter error check
yuki-kimoto authored on 2010-05-14
154
        
cleanup
yuki-kimoto authored on 2010-08-05
155
        # Filtering
type_rule can receive filter...
Yuki Kimoto authored on 2011-06-12
156
        $row_hash->{$column} = $f && !$self->filter_off ? $f->($row->[$i])
157
                                                        : $row->[$i];
158
        $row_hash->{$column} = $ef->($row_hash->{$column})
159
          if $ef && !$self->filter_off;
packaging one directory
yuki-kimoto authored on 2009-11-16
160
    }
161
    
removed reconnect method
yuki-kimoto authored on 2010-05-28
162
    return $row_hash;
packaging one directory
yuki-kimoto authored on 2009-11-16
163
}
164

            
cleanup
yuki-kimoto authored on 2010-10-17
165
sub fetch_hash_all {
166
    my $self = shift;
167
    
168
    # Fetch all rows as hash
169
    my $rows = [];
170
    while(my $row = $self->fetch_hash) {
171
        push @$rows, $row;
172
    }
173
    
174
    return $rows;
175
}
176

            
removed reconnect method
yuki-kimoto authored on 2010-05-28
177
sub fetch_hash_first {
packaging one directory
yuki-kimoto authored on 2009-11-16
178
    my $self = shift;
179
    
180
    # Fetch hash
181
    my $row = $self->fetch_hash;
182
    
cleanup
yuki-kimoto authored on 2010-08-05
183
    # No row
packaging one directory
yuki-kimoto authored on 2009-11-16
184
    return unless $row;
185
    
186
    # Finish statement handle
some changed
yuki-kimoto authored on 2010-05-02
187
    $self->sth->finish;
packaging one directory
yuki-kimoto authored on 2009-11-16
188
    
removed reconnect method
yuki-kimoto authored on 2010-05-28
189
    return $row;
packaging one directory
yuki-kimoto authored on 2009-11-16
190
}
191

            
renamed fetch_rows to fetch_...
yuki-kimoto authored on 2010-05-01
192
sub fetch_hash_multi {
packaging one directory
yuki-kimoto authored on 2009-11-16
193
    my ($self, $count) = @_;
194
    
cleanup
yuki-kimoto authored on 2010-08-05
195
    # Row count not specified
cleanup
Yuki Kimoto authored on 2011-04-25
196
    croak 'Row count must be specified ' . _subname
packaging one directory
yuki-kimoto authored on 2009-11-16
197
      unless $count;
198
    
199
    # Fetch multi rows
200
    my $rows = [];
201
    for (my $i = 0; $i < $count; $i++) {
removed reconnect method
yuki-kimoto authored on 2010-05-28
202
        my $row = $self->fetch_hash;
203
        last unless $row;
204
        push @$rows, $row;
packaging one directory
yuki-kimoto authored on 2009-11-16
205
    }
206
    
207
    return unless @$rows;
removed reconnect method
yuki-kimoto authored on 2010-05-28
208
    return $rows;
packaging one directory
yuki-kimoto authored on 2009-11-16
209
}
210

            
cleanup
yuki-kimoto authored on 2010-10-17
211
sub fetch_multi {
212
    my ($self, $count) = @_;
packaging one directory
yuki-kimoto authored on 2009-11-16
213
    
cleanup
yuki-kimoto authored on 2010-10-17
214
    # Row count not specifed
cleanup
Yuki Kimoto authored on 2011-04-25
215
    croak 'Row count must be specified ' . _subname
cleanup
yuki-kimoto authored on 2010-10-17
216
      unless $count;
217
    
218
    # Fetch multi rows
packaging one directory
yuki-kimoto authored on 2009-11-16
219
    my $rows = [];
cleanup
yuki-kimoto authored on 2010-10-17
220
    for (my $i = 0; $i < $count; $i++) {
221
        my $row = $self->fetch;
222
        last unless $row;
removed reconnect method
yuki-kimoto authored on 2010-05-28
223
        push @$rows, $row;
packaging one directory
yuki-kimoto authored on 2009-11-16
224
    }
changed argument of tag proc...
yuki-kimoto authored on 2010-08-03
225
    
cleanup
yuki-kimoto authored on 2010-10-17
226
    return unless @$rows;
removed reconnect method
yuki-kimoto authored on 2010-05-28
227
    return $rows;
packaging one directory
yuki-kimoto authored on 2009-11-16
228
}
229

            
- added DBIx::Custom::Result...
Yuki Kimoto authored on 2011-06-07
230
*one = \&fetch_hash_first;
231

            
cleanup
Yuki Kimoto authored on 2011-06-13
232
# DEPRECATED!
233
sub end_filter {
234
    my $self = shift;
235
    
236
    if (@_) {
237
        my $end_filter = {};
238
        
239
        if (ref $_[0] eq 'HASH') {
240
            $end_filter = $_[0];
241
        }
242
        else {
243
            $end_filter = _array_to_hash(
244
                @_ > 1 ? [@_] : $_[0]
245
            );
246
        }
247
        
248
        foreach my $column (keys %$end_filter) {
249
            my $fname = $end_filter->{$column};
250
            
251
            if  (exists $end_filter->{$column}
252
              && defined $fname
253
              && ref $fname ne 'CODE') 
254
            {
255
              croak qq{Filter "$fname" is not registered" } . _subname
256
                unless exists $self->filters->{$fname};
257
              
258
              $end_filter->{$column} = $self->filters->{$fname};
259
            }
260
        }
261
        
262
        $self->{end_filter} = {%{$self->end_filter}, %$end_filter};
263
        
264
        return $self;
265
    }
266
    
267
    return $self->{end_filter} ||= {};
268
}
269

            
cleanup
Yuki Kimoto authored on 2011-06-13
270
# DEPRECATED!
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-02-28
271
sub remove_end_filter {
272
    my $self = shift;
273
    
cleanup
Yuki Kimoto authored on 2011-06-13
274
    warn "remove_end_filter is DEPRECATED! use filter_off attribute instead";
275
    
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-02-28
276
    $self->{end_filter} = {};
277
    
278
    return $self;
279
}
280

            
cleanup
Yuki Kimoto authored on 2011-06-13
281
# DEPRECATED!
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-02-28
282
sub remove_filter {
283
    my $self = shift;
cleanup
Yuki Kimoto authored on 2011-06-13
284

            
285
    warn "remove_filter is DEPRECATED! use filter_off attribute instead";
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-02-28
286
    
287
    $self->{filter} = {};
288
    
289
    return $self;
290
}
291

            
cleanup
Yuki Kimoto authored on 2011-06-13
292
# DEPRECATED!
cleanup
Yuki Kimoto authored on 2011-01-12
293
sub default_filter {
294
    my $self = shift;
cleanup
Yuki Kimoto authored on 2011-06-13
295

            
cleanup
Yuki Kimoto authored on 2011-06-13
296
    warn "default_filter is DEPRECATED!";
cleanup
Yuki Kimoto authored on 2011-01-12
297
    
298
    if (@_) {
299
        my $fname = $_[0];
300
        if (@_ && !$fname) {
301
            $self->{default_filter} = undef;
302
        }
303
        else {
many changed
Yuki Kimoto authored on 2011-01-23
304
            croak qq{Filter "$fname" is not registered}
cleanup
Yuki Kimoto authored on 2011-01-12
305
              unless exists $self->filters->{$fname};
306
        
307
            $self->{default_filter} = $self->filters->{$fname};
308
        }
309
        
310
        return $self;
311
    }
312
    
313
    return $self->{default_filter};
314
}
315

            
cleanup
Yuki Kimoto authored on 2011-01-23
316
# DEPRECATED!
cleanup
Yuki Kimoto authored on 2011-06-13
317
has 'filter_check'; 
cleanup
Yuki Kimoto authored on 2011-01-23
318

            
update document
yuki-kimoto authored on 2010-01-30
319
1;
320

            
packaging one directory
yuki-kimoto authored on 2009-11-16
321
=head1 NAME
322

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

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

            
327
Get the result of select statement.
328

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

            
332
Fetch row into array.
removed reconnect method
yuki-kimoto authored on 2010-05-28
333
    
334
    # Fetch a row into array
335
    while (my $row = $result->fetch) {
cleanup
yuki-kimoto authored on 2010-08-05
336
        my $author = $row->[0];
337
        my $title  = $row->[1];
removed reconnect method
yuki-kimoto authored on 2010-05-28
338
        
version 0.0901
yuki-kimoto authored on 2009-12-17
339
    }
340
    
cleanup
yuki-kimoto authored on 2010-08-05
341
    # Fetch only a first row into array
removed reconnect method
yuki-kimoto authored on 2010-05-28
342
    my $row = $result->fetch_first;
343
    
344
    # Fetch multiple rows into array of array
345
    while (my $rows = $result->fetch_multi(5)) {
cleanup
yuki-kimoto authored on 2010-08-05
346
        my $first_author  = $rows->[0][0];
347
        my $first_title   = $rows->[0][1];
348
        my $second_author = $rows->[1][0];
349
        my $second_value  = $rows->[1][1];
350
    
removed reconnect method
yuki-kimoto authored on 2010-05-28
351
    }
352
    
353
    # Fetch all rows into array of array
354
    my $rows = $result->fetch_all;
cleanup
yuki-kimoto authored on 2010-08-05
355

            
356
Fetch row into hash.
357

            
358
    # Fetch a row into hash
removed reconnect method
yuki-kimoto authored on 2010-05-28
359
    while (my $row = $result->fetch_hash) {
cleanup
yuki-kimoto authored on 2010-08-05
360
        my $title  = $row->{title};
361
        my $author = $row->{author};
removed reconnect method
yuki-kimoto authored on 2010-05-28
362
        
packaging one directory
yuki-kimoto authored on 2009-11-16
363
    }
removed reconnect method
yuki-kimoto authored on 2010-05-28
364
    
cleanup
yuki-kimoto authored on 2010-08-05
365
    # Fetch only a first row into hash
removed reconnect method
yuki-kimoto authored on 2010-05-28
366
    my $row = $result->fetch_hash_first;
367
    
368
    # Fetch multiple rows into array of hash
cleanup
yuki-kimoto authored on 2010-08-05
369
    while (my $rows = $result->fetch_hash_multi(5)) {
370
        my $first_title   = $rows->[0]{title};
371
        my $first_author  = $rows->[0]{author};
372
        my $second_title  = $rows->[1]{title};
373
        my $second_author = $rows->[1]{author};
removed reconnect method
yuki-kimoto authored on 2010-05-28
374
    }
375
    
376
    # Fetch all rows into array of hash
377
    my $rows = $result->fetch_hash_all;
packaging one directory
yuki-kimoto authored on 2009-11-16
378

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

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

            
updated_pod
Yuki Kimoto authored on 2011-06-12
384
=head2 C<filter_off> EXPERIMENTAL
385

            
386
    my $filter_off = $resutl->filter_off;
387
    $result = $result->filter_off(1);
388

            
389
Turn filter off.
390

            
cleanup
yuki-kimoto authored on 2010-10-17
391
=head2 C<filters>
392

            
393
    my $filters = $result->filters;
394
    $result     = $result->filters(\%filters);
395

            
396
Resistered filters.
397

            
398
=head2 C<sth>
399

            
400
    my $sth = $reuslt->sth
401
    $result = $result->sth($sth);
402

            
403
Statement handle of L<DBI>.
404

            
added EXPERIMENTAL execute()...
Yuki Kimoto authored on 2011-06-09
405
=head2 C<type_rule_off> EXPERIMENTAL
406

            
407
    my $type_rule_off = $result->type_rule_off;
408
    $result = $result->type_rule_off(1);
409

            
410
Turn type rule off.
411

            
update document
yuki-kimoto authored on 2010-01-30
412
=head1 METHODS
413

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

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

            
419
    my $rows = $result->all;
420

            
421
This is alias for C<fetch_hash_all>.
422

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

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

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

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

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

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

            
cleanup
yuki-kimoto authored on 2010-10-17
435
=head2 C<fetch_first>
436

            
437
    my $row = $result->fetch_first;
438

            
439
Fetch only a first row into array and finish statment handle.
440

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

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

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

            
cleanup
yuki-kimoto authored on 2010-10-17
447
=head2 C<fetch_hash_all>
448

            
449
    my $rows = $result->fetch_hash_all;
450

            
451
Fetch all rows into array of hash.
452

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

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

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

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

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

            
cleanup
yuki-kimoto authored on 2010-10-17
468
    my $rows = $result->fetch_multi(5);
469
    
470
Fetch multiple rows into array of array.
471
Row count must be specified.
removed DESTROY method(not b...
yuki-kimoto authored on 2010-07-18
472

            
cleanup
Yuki Kimoto authored on 2010-12-21
473
=head2 C<filter>
474

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

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

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

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

            
486
    my $row = $result->one;
487

            
488
This is alias for C<fetch_hash_first>.
489

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

            
492
    $result->remove_filter;
493

            
494
Remove filter. End filter is not removed.
495

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

            
498
    my $stash = $result->stash;
499
    my $foo = $result->stash->{foo};
500
    $result->stash->{foo} = $foo;
501

            
502
Stash is hash reference to save your data.
503

            
EXPERIMENTAL type_rule_off i...
Yuki Kimoto authored on 2011-06-14
504
=head2 C<remove_end_filter> DEPRECATED!
505

            
506
    $result->remove_end_filter;
507

            
508
Remove end filter.
509

            
510
=head2 C<end_filter> DEPRECATED!
511

            
512
    $result = $result->end_filter(title  => 'to_something',
513
                                     author => 'to_something');
514

            
515
    $result = $result->end_filter([qw/title author/] => 'to_something');
516

            
517
End filters.
518
These each filters is executed after the filters applied by C<apply_filter> of
519
L<DBIx::Custom> or C<filter> method.
520

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