The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

DBIx::Kohada::AnonRow - Anonymous Row Object

DESCRIPTION

This object is an anonymous row object. It's instance is created by $db-search_by_sql(undef, $sql, @binds)> or $db-search_by_query_object($query)> method.

This class defines AUTOLOAD method. If you calls missing method, then you get the column data on the method name.

    $row->foo();
    # is equivalent to
    $row->get_column('foo');

METHODS

my $row = DBIx::Kohada::AnonRow->new(%args);

Create new instance of DBIx::Kohada::AnonRow. The arguments are:

\%row_data

It contains fetched data in hashref.

my @columns = $row->columns();
my $columns = $row->columns(); # ArrayRef in scalar context.

This method returns the fetched column names.

This method looks context by wantarray.

my $val = $row->get_column($column_name);

Return: The value of column.

Get the column data from row.

This method throws exception if the $column_name is not exists in the fetched data.

my $data = $row->get_columns();

Returns all loaded column data as a hash, containing raw values. To get just one value for a particular column, use "get_column".

Returns: A hashref of column name, value pairs.