Newer Older
501 lines | 10.468kb
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(
added type_rule method and f...
Yuki Kimoto authored on 2011-06-09
12
    [qw/filters sth type_rule/],
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-25
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};
added type_rule method and f...
Yuki Kimoto authored on 2011-06-09
109
    my $types = $self->{sth}->{TYPE};
110
    my $type_rule = $self->type_rule || {};
111
    
cleanup
yuki-kimoto authored on 2010-08-05
112
    for (my $i = 0; $i < @$columns; $i++) {
update document
yuki-kimoto authored on 2010-05-27
113
        
added type_rule method and f...
Yuki Kimoto authored on 2011-06-09
114
        if ($type_rule->{$types->[$i]} &&
115
            (my $rule = $type_rule->{$types->[$i]}->{from}))
116
        {
117
            $row[$i] = $rule->($row[$i]);
118
        }
119
        
changed argument of tag proc...
yuki-kimoto authored on 2010-08-03
120
        # Filter name
cleanup
yuki-kimoto authored on 2010-08-05
121
        my $column = $columns->[$i];
cleanup
Yuki Kimoto authored on 2010-12-21
122
        my $f  = exists $filter->{$column}
123
               ? $filter->{$column}
cleanup
Yuki Kimoto authored on 2010-12-22
124
               : $self->default_filter;
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-17
125
        my $ef = $end_filter->{$column};
some changed
yuki-kimoto authored on 2010-05-02
126
        
cleanup
yuki-kimoto authored on 2010-08-05
127
        # Filtering
cleanup
Yuki Kimoto authored on 2010-12-21
128
        $row[$i] = $f->($row[$i]) if $f;
added experimental DBIx::Cus...
Yuki Kimoto authored on 2011-01-17
129
        $row[$i] = $ef->($row[$i]) if $ef;
packaging one directory
yuki-kimoto authored on 2009-11-16
130
    }
many many changes
yuki-kimoto authored on 2010-04-30
131

            
removed reconnect method
yuki-kimoto authored on 2010-05-28
132
    return \@row;
133
}
134

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

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

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

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

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

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

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

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

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

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

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

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

            
cleanup
Yuki Kimoto authored on 2011-01-23
310
# DEPRECATED!
311
__PACKAGE__->attr('filter_check'); 
312

            
update document
yuki-kimoto authored on 2010-01-30
313
1;
314

            
packaging one directory
yuki-kimoto authored on 2009-11-16
315
=head1 NAME
316

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

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

            
321
Get the result of select statement.
322

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

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

            
350
Fetch row into hash.
351

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

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

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

            
cleanup
yuki-kimoto authored on 2010-10-17
378
=head2 C<filters>
379

            
380
    my $filters = $result->filters;
381
    $result     = $result->filters(\%filters);
382

            
383
Resistered filters.
384

            
385
=head2 C<sth>
386

            
387
    my $sth = $reuslt->sth
388
    $result = $result->sth($sth);
389

            
390
Statement handle of L<DBI>.
391

            
update document
yuki-kimoto authored on 2010-01-30
392
=head1 METHODS
393

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

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

            
399
    my $rows = $result->all;
400

            
401
This is alias for C<fetch_hash_all>.
402

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

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

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

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

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

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

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

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

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

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

            
cleanup
yuki-kimoto authored on 2010-10-17
426
=head2 C<fetch_first>
427

            
428
    my $row = $result->fetch_first;
429

            
430
Fetch only a first row into array and finish statment handle.
431

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

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

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

            
cleanup
yuki-kimoto authored on 2010-10-17
438
=head2 C<fetch_hash_all>
439

            
440
    my $rows = $result->fetch_hash_all;
441

            
442
Fetch all rows into array of hash.
443

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

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

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

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

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

            
cleanup
yuki-kimoto authored on 2010-10-17
459
    my $rows = $result->fetch_multi(5);
460
    
461
Fetch multiple rows into array of array.
462
Row count must be specified.
removed DESTROY method(not b...
yuki-kimoto authored on 2010-07-18
463

            
cleanup
Yuki Kimoto authored on 2010-12-21
464
=head2 C<filter>
465

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

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

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

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

            
477
    my $row = $result->one;
478

            
479
This is alias for C<fetch_hash_first>.
480

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

            
483
    $result->remove_end_filter;
484

            
485
Remove end filter.
486

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

            
489
    $result->remove_filter;
490

            
491
Remove filter. End filter is not removed.
492

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

            
495
    my $stash = $result->stash;
496
    my $foo = $result->stash->{foo};
497
    $result->stash->{foo} = $foo;
498

            
499
Stash is hash reference to save your data.
500

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