| 1 | 2 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | |||
| 3 | package Interchange6::Schema::ResultSet::Order; | ||
| 4 | |||
| 5 | =head1 NAME | ||
| 6 | |||
| 7 | Interchange6::Schema::ResultSet::Order | ||
| 8 | |||
| 9 | =cut | ||
| 10 | |||
| 11 | =head1 SYNOPSIS | ||
| 12 | |||
| 13 | Provides extra accessor methods for L<Interchange6::Schema::Result::Order> | ||
| 14 | |||
| 15 | =cut | ||
| 16 | |||
| 17 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 18 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 19 | |||
| 20 | 2 | ▶ | use parent 'Interchange6::Schema::ResultSet'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 21 | |||
| 22 | =head1 METHODS | ||
| 23 | |||
| 24 | =head2 with_status | ||
| 25 | |||
| 26 | Adds C<status> column which is available to order_by clauses and | ||
| 27 | whose value can be retrieved via | ||
| 28 | L<Interchange6::Schema::Result::Order/status>. | ||
| 29 | |||
| 30 | =cut | ||
| 31 | |||
| 32 | sub with_status { | ||
| 33 | 1 | ▶ | my $self = shift; |
|
Subroutine
with_status: called CC=1 SCAR=0.0
Pod
documented
| |||
| 34 | |||
| 35 | 1 | my $me = $self->me; | |
| 36 | |||
| 37 | 1 | return $self->search( | |
| 38 | undef, | ||
| 39 | { | ||
| 40 | '+columns' => { | ||
| 41 | status => $self->correlate('statuses')->rows(1) | ||
| 42 | ->order_by('!created,!order_status_id')->get_column('status') | ||
| 43 | ->as_query, | ||
| 44 | }, | ||
| 45 | } | ||
| 46 | ); | ||
| 47 | } | ||
| 48 | |||
| 49 | 2 | 1; | |