File: Gnarly.pm

package info (click to toggle)
libdbix-class-helpers-perl 2.013002-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 420 kB
  • sloc: perl: 1,931; sql: 73; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 640 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package TestSchema::ResultSet::Gnarly;
use strict;
use warnings;

use parent 'TestSchema::ResultSet';

__PACKAGE__->load_components(qw{ Helper::ResultSet::Me Helper::ResultSet::ResultClassDWIM Helper::ResultSet::CorrelateRelationship Helper::ResultSet::SearchOr Helper::ResultSet::NoColumns });

sub with_id_plus_one {
   my $self = shift;
   my $id = $self->me . 'id';
   $self->search(undef, {
      '+columns' => {
         id_plus_one => \"$id + 1",
      },
   })
}

sub id_plus_two {
   my $self = shift;
   my $id = $self->me . 'id';
   $self->search(undef, {
      '+columns' => {
         plus2 => \"$id + 2",
      },
   })
}

1;