Newer Older
512 lines | 10.915kb
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

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

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

            
removed reconnect method
yuki-kimoto authored on 2010-05-28
127
    return \@row;
128
}
129

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

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

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

            
packaging one directory
yuki-kimoto authored on 2009-11-16
171
    # Filter
172
    my $row_hash = {};
added experimental iterate_a...
Yuki Kimoto authored on 2010-12-22
173
    my $columns = $self->{sth}->{NAME};
added type_rule method and f...
Yuki Kimoto authored on 2011-06-09
174
    my $types = $self->{sth}->{TYPE};
175
    my $type_rule = $self->type_rule || {};
cleanup
yuki-kimoto authored on 2010-08-05
176
    for (my $i = 0; $i < @$columns; $i++) {
update document
yuki-kimoto authored on 2010-05-27
177
        
added type_rule method and f...
Yuki Kimoto authored on 2011-06-09
178
        # Type rule
changed type_rule arguments ...
Yuki Kimoto authored on 2011-06-12
179
        if (!$self->type_rule_off && $type_rule->{from} &&
180
            (my $rule = $type_rule->{from}->{$types->[$i]}))
added type_rule method and f...
Yuki Kimoto authored on 2011-06-09
181
        {
182
            $row->[$i] = $rule->($row->[$i]);
183
        }
184
        
changed argument of tag proc...
yuki-kimoto authored on 2010-08-03
185
        # Filter name
cleanup
yuki-kimoto authored on 2010-08-05
186
        my $column = $columns->[$i];
cleanup
Yuki Kimoto authored on 2010-12-21
187
        my $f  = exists $filter->{$column}
188
               ? $filter->{$column}
cleanup
Yuki Kimoto authored on 2010-12-22
189
               : $self->default_filter;
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-17
190
        my $ef = $end_filter->{$column};
add query filter error check
yuki-kimoto authored on 2010-05-14
191
        
cleanup
yuki-kimoto authored on 2010-08-05
192
        # Filtering
type_rule can receive filter...
Yuki Kimoto authored on 2011-06-12
193
        $row_hash->{$column} = $f && !$self->filter_off ? $f->($row->[$i])
194
                                                        : $row->[$i];
195
        $row_hash->{$column} = $ef->($row_hash->{$column})
196
          if $ef && !$self->filter_off;
packaging one directory
yuki-kimoto authored on 2009-11-16
197
    }
198
    
removed reconnect method
yuki-kimoto authored on 2010-05-28
199
    return $row_hash;
packaging one directory
yuki-kimoto authored on 2009-11-16
200
}
201

            
cleanup
yuki-kimoto authored on 2010-10-17
202
sub fetch_hash_all {
203
    my $self = shift;
204
    
205
    # Fetch all rows as hash
206
    my $rows = [];
207
    while(my $row = $self->fetch_hash) {
208
        push @$rows, $row;
209
    }
210
    
211
    return $rows;
212
}
213

            
removed reconnect method
yuki-kimoto authored on 2010-05-28
214
sub fetch_hash_first {
packaging one directory
yuki-kimoto authored on 2009-11-16
215
    my $self = shift;
216
    
217
    # Fetch hash
218
    my $row = $self->fetch_hash;
219
    
cleanup
yuki-kimoto authored on 2010-08-05
220
    # No row
packaging one directory
yuki-kimoto authored on 2009-11-16
221
    return unless $row;
222
    
223
    # Finish statement handle
some changed
yuki-kimoto authored on 2010-05-02
224
    $self->sth->finish;
packaging one directory
yuki-kimoto authored on 2009-11-16
225
    
removed reconnect method
yuki-kimoto authored on 2010-05-28
226
    return $row;
packaging one directory
yuki-kimoto authored on 2009-11-16
227
}
228

            
renamed fetch_rows to fetch_...
yuki-kimoto authored on 2010-05-01
229
sub fetch_hash_multi {
packaging one directory
yuki-kimoto authored on 2009-11-16
230
    my ($self, $count) = @_;
231
    
cleanup
yuki-kimoto authored on 2010-08-05
232
    # Row count not specified
cleanup
Yuki Kimoto authored on 2011-04-25
233
    croak 'Row count must be specified ' . _subname
packaging one directory
yuki-kimoto authored on 2009-11-16
234
      unless $count;
235
    
236
    # Fetch multi rows
237
    my $rows = [];
238
    for (my $i = 0; $i < $count; $i++) {
removed reconnect method
yuki-kimoto authored on 2010-05-28
239
        my $row = $self->fetch_hash;
240
        last unless $row;
241
        push @$rows, $row;
packaging one directory
yuki-kimoto authored on 2009-11-16
242
    }
243
    
244
    return unless @$rows;
removed reconnect method
yuki-kimoto authored on 2010-05-28
245
    return $rows;
packaging one directory
yuki-kimoto authored on 2009-11-16
246
}
247

            
cleanup
yuki-kimoto authored on 2010-10-17
248
sub fetch_multi {
249
    my ($self, $count) = @_;
packaging one directory
yuki-kimoto authored on 2009-11-16
250
    
cleanup
yuki-kimoto authored on 2010-10-17
251
    # Row count not specifed
cleanup
Yuki Kimoto authored on 2011-04-25
252
    croak 'Row count must be specified ' . _subname
cleanup
yuki-kimoto authored on 2010-10-17
253
      unless $count;
254
    
255
    # Fetch multi rows
packaging one directory
yuki-kimoto authored on 2009-11-16
256
    my $rows = [];
cleanup
yuki-kimoto authored on 2010-10-17
257
    for (my $i = 0; $i < $count; $i++) {
258
        my $row = $self->fetch;
259
        last unless $row;
removed reconnect method
yuki-kimoto authored on 2010-05-28
260
        push @$rows, $row;
packaging one directory
yuki-kimoto authored on 2009-11-16
261
    }
changed argument of tag proc...
yuki-kimoto authored on 2010-08-03
262
    
cleanup
yuki-kimoto authored on 2010-10-17
263
    return unless @$rows;
removed reconnect method
yuki-kimoto authored on 2010-05-28
264
    return $rows;
packaging one directory
yuki-kimoto authored on 2009-11-16
265
}
266

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

            
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-02-28
269
sub remove_end_filter {
270
    my $self = shift;
271
    
272
    $self->{end_filter} = {};
273
    
274
    return $self;
275
}
276

            
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-02-28
277
sub remove_filter {
278
    my $self = shift;
279
    
280
    $self->{filter} = {};
281
    
282
    return $self;
283
}
284

            
cleanup
Yuki Kimoto authored on 2011-01-12
285
# Deprecated
286
sub default_filter {
287
    my $self = shift;
288
    
289
    if (@_) {
290
        my $fname = $_[0];
291
        if (@_ && !$fname) {
292
            $self->{default_filter} = undef;
293
        }
294
        else {
many changed
Yuki Kimoto authored on 2011-01-23
295
            croak qq{Filter "$fname" is not registered}
cleanup
Yuki Kimoto authored on 2011-01-12
296
              unless exists $self->filters->{$fname};
297
        
298
            $self->{default_filter} = $self->filters->{$fname};
299
        }
300
        
301
        return $self;
302
    }
303
    
304
    return $self->{default_filter};
305
}
306

            
cleanup
Yuki Kimoto authored on 2011-01-23
307
# DEPRECATED!
308
__PACKAGE__->attr('filter_check'); 
309

            
update document
yuki-kimoto authored on 2010-01-30
310
1;
311

            
packaging one directory
yuki-kimoto authored on 2009-11-16
312
=head1 NAME
313

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

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

            
318
Get the result of select statement.
319

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

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

            
347
Fetch row into hash.
348

            
349
    # Fetch a row into hash
removed reconnect method
yuki-kimoto authored on 2010-05-28
350
    while (my $row = $result->fetch_hash) {
cleanup
yuki-kimoto authored on 2010-08-05
351
        my $title  = $row->{title};
352
        my $author = $row->{author};
removed reconnect method
yuki-kimoto authored on 2010-05-28
353
        
packaging one directory
yuki-kimoto authored on 2009-11-16
354
    }
removed reconnect method
yuki-kimoto authored on 2010-05-28
355
    
cleanup
yuki-kimoto authored on 2010-08-05
356
    # Fetch only a first row into hash
removed reconnect method
yuki-kimoto authored on 2010-05-28
357
    my $row = $result->fetch_hash_first;
358
    
359
    # Fetch multiple rows into array of hash
cleanup
yuki-kimoto authored on 2010-08-05
360
    while (my $rows = $result->fetch_hash_multi(5)) {
361
        my $first_title   = $rows->[0]{title};
362
        my $first_author  = $rows->[0]{author};
363
        my $second_title  = $rows->[1]{title};
364
        my $second_author = $rows->[1]{author};
removed reconnect method
yuki-kimoto authored on 2010-05-28
365
    }
366
    
367
    # Fetch all rows into array of hash
368
    my $rows = $result->fetch_hash_all;
packaging one directory
yuki-kimoto authored on 2009-11-16
369

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

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

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

            
377
    my $filter_off = $resutl->filter_off;
378
    $result = $result->filter_off(1);
379

            
380
Turn filter off.
381

            
cleanup
yuki-kimoto authored on 2010-10-17
382
=head2 C<filters>
383

            
384
    my $filters = $result->filters;
385
    $result     = $result->filters(\%filters);
386

            
387
Resistered filters.
388

            
389
=head2 C<sth>
390

            
391
    my $sth = $reuslt->sth
392
    $result = $result->sth($sth);
393

            
394
Statement handle of L<DBI>.
395

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

            
398
    my $type_rule_off = $result->type_rule_off;
399
    $result = $result->type_rule_off(1);
400

            
401
Turn type rule off.
402

            
update document
yuki-kimoto authored on 2010-01-30
403
=head1 METHODS
404

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

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

            
410
    my $rows = $result->all;
411

            
412
This is alias for C<fetch_hash_all>.
413

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

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

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

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

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

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

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

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

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

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

            
cleanup
yuki-kimoto authored on 2010-10-17
437
=head2 C<fetch_first>
438

            
439
    my $row = $result->fetch_first;
440

            
441
Fetch only a first row into array and finish statment handle.
442

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

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

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

            
cleanup
yuki-kimoto authored on 2010-10-17
449
=head2 C<fetch_hash_all>
450

            
451
    my $rows = $result->fetch_hash_all;
452

            
453
Fetch all rows into array of hash.
454

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

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

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

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

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

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

            
cleanup
Yuki Kimoto authored on 2010-12-21
475
=head2 C<filter>
476

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

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

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

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

            
488
    my $row = $result->one;
489

            
490
This is alias for C<fetch_hash_first>.
491

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

            
494
    $result->remove_end_filter;
495

            
496
Remove end filter.
497

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

            
500
    $result->remove_filter;
501

            
502
Remove filter. End filter is not removed.
503

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

            
506
    my $stash = $result->stash;
507
    my $foo = $result->stash->{foo};
508
    $result->stash->{foo} = $foo;
509

            
510
Stash is hash reference to save your data.
511

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