| 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 | 2 | ▶ | use mro 'c3'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 20 | |||
| 21 | 2 | ▶ | use parent 'Interchange6::Schema::ResultSet'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 22 | |||
| 23 | =head1 METHODS | ||
| 24 | |||
| 25 | =head2 with_status | ||
| 26 | |||
| 27 | Adds C<status> column which is available to order_by clauses and | ||
| 28 | whose value can be retrieved via | ||
| 29 | L<Interchange6::Schema::Result::Order/status>. | ||
| 30 | |||
| 31 | =cut | ||
| 32 | |||
| 33 | sub with_status { | ||
| 34 | 1 | ▶ | my $self = shift; |
|
Subroutine
with_status: called CC=1 SCAR=0.0
Pod
documented
| |||
| 35 | |||
| 36 | 1 | return $self->search( | |
| 37 | undef, | ||
| 38 | { | ||
| 39 | '+columns' => { | ||
| 40 | status => $self->correlate('statuses')->rows(1) | ||
| 41 | ->order_by('!created,!order_status_id')->get_column('status') | ||
| 42 | ->as_query, | ||
| 43 | }, | ||
| 44 | } | ||
| 45 | ); | ||
| 46 | } | ||
| 47 | |||
| 48 | 2 | 1; | |