| 1 | package Fey::Role::SQL::HasBindParams; | ||
| 2 | |||
| 3 | 27 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 27 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 27 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 27 | our $VERSION = '0.44'; | |
| 8 | |||
| 9 | 27 | ▶ | use Fey::Types qw( ArrayRef Bool ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 27 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | has '_bind_params' => ( | ||
| 14 | traits => ['Array'], | ||
| 15 | is => 'ro', | ||
| 16 | isa => ArrayRef, | ||
| 17 | 220 | ▶ | default => sub { [] }, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 18 | 27 | handles => { _add_bind_param => 'push' }, | |
| 19 | init_arg => undef, | ||
| 20 | ); | ||
| 21 | |||
| 22 | 27 | has 'auto_placeholders' => ( | |
| 23 | is => 'ro', | ||
| 24 | isa => Bool, | ||
| 25 | default => 1, | ||
| 26 | ); | ||
| 27 | |||
| 28 | # This needs to be a method and not a delegated method so it can be excluded | ||
| 29 | # by classes which need to exclude it. | ||
| 30 | 11 | ▶ | sub bind_params { |
|
Subroutine
bind_params: called CC=1 SCAR=0.0
Pod
documented
| |||
| 31 | 11 | return @{ $_[0]->_bind_params() }; | |
| 32 | } | ||
| 33 | |||
| 34 | 27 | 1; | |
| 35 | |||
| 36 | # ABSTRACT: A role for queries which can have bind parameters | ||
| 37 | |||
| 38 | __END__ | ||