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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            
update document
yuki-kimoto authored on 2010-01-30
291
1;
292

            
packaging one directory
yuki-kimoto authored on 2009-11-16
293
=head1 NAME
294

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

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

            
299
Get the result of select statement.
300

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

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

            
328
Fetch row into hash.
329

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

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

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

            
cleanup
yuki-kimoto authored on 2010-10-17
356
=head2 C<filters>
357

            
358
    my $filters = $result->filters;
359
    $result     = $result->filters(\%filters);
360

            
361
Resistered filters.
362

            
363
=head2 C<sth>
364

            
365
    my $sth = $reuslt->sth
366
    $result = $result->sth($sth);
367

            
368
Statement handle of L<DBI>.
369

            
update document
yuki-kimoto authored on 2010-01-30
370
=head1 METHODS
371

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

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

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

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

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

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

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

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

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

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

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

            
cleanup
yuki-kimoto authored on 2010-10-17
398
=head2 C<fetch_first>
399

            
400
    my $row = $result->fetch_first;
401

            
402
Fetch only a first row into array and finish statment handle.
403

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

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

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

            
cleanup
yuki-kimoto authored on 2010-10-17
410
=head2 C<fetch_hash_all>
411

            
412
    my $rows = $result->fetch_hash_all;
413

            
414
Fetch all rows into array of hash.
415

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

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

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

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

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

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

            
cleanup
Yuki Kimoto authored on 2010-12-21
436
=head2 C<filter>
437

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

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

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

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

            
449
    $result->remove_end_filter;
450

            
451
Remove end filter.
452

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

            
455
    $result->remove_filter;
456

            
457
Remove filter. End filter is not removed.
458

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

            
461
    my $stash = $result->stash;
462
    my $foo = $result->stash->{foo};
463
    $result->stash->{foo} = $foo;
464

            
465
Stash is hash reference to save your data.
466

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