Skip to content
Snippets Groups Projects
Commit 0c9ffbd8 authored by Andy Yates's avatar Andy Yates
Browse files

Need to give this the option to pass in a callback so you can return a 1D array of anything

parent 45e2cbc8
No related branches found
No related tags found
No related merge requests found
......@@ -257,6 +257,7 @@ sub execute {
Arg [SQL] : SQL to execute
Arg [PARAMS] : The binding parameters to the SQL statement
Arg [CALLBACK] : Allows you to give a callback to do the mapping with
Returntype : 1D array of data points
Exceptions : If errors occur in the execution of the SQL
Status : Stable
......@@ -274,10 +275,10 @@ by the given SQL statement.
sub execute_simple {
my ( $self, @args ) = @_;
my ($sql, $params) = rearrange([qw(sql params)], @args);
my ($sql, $params, $callback) = rearrange([qw(sql params callback)], @args);
my $has_return = 1;
my $use_hashrefs = 0;
my $callback = $self->_mappers()->{first_element};
$callback ||= $self->_mappers()->{first_element};
return $self->_execute($sql, $callback, $has_return, $use_hashrefs, $params);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment