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

NAME

Teng::Iterator - Iterator for Teng

DESCRIPTION

This is an iterator class for Teng.

SYNOPSIS

  my $itr = Your::Model->search('user',{});
  
  my @rows = $itr->all; # get all rows

  # do iteration
  while (my $row = $itr->next) {
    ...
  }

METHODS

$itr = Teng::Iterator->new()

Create new Teng::Iterator's object. You may not call this method directly.

my $row = $itr->next();

Get next row data.

my @ary = $itr->all;

Get all row data in array.

$itr->suppress_object_creation($bool)

Set row object creation mode.

$itr->apply_sql_types($bool)

Set column type application mode.

If column has SQL type and it is numeric, regard it as number and add 0 to the value. If column has SQL type and it isn't numeric, regard it as string and add '' to the value. If column doesn't have SQL type, the value won't be changed.

$itr->guess_sql_types($bool)

If this is true, this implies apply_sql_types also true. If column has no SQL type, it guesses SQL type with its value. When column value likes numeric, regard it as number and add 0 to the value. If not, regard it as string and add '' to the value.