GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
SQLEngine::RecordSet::Set(3) User Contributed Perl Documentation SQLEngine::RecordSet::Set(3)

DBIx::SQLEngine::RecordSet::Set - Array of Record Objects

  use DBIx::SQLEngine::RecordSet::Set;

  $record_set = DBIx::SQLEngine::RecordSet::Set->new( @records );

  $record_set = $record_class->fetch_select( criteria => { status => 2 } );
  
  print "Found " . $record_set->count() . " records";

  $record_set->filter( { 'status' => 'New' } );
  $record_set->sort( 'creation_date' );
  
  foreach ( 0 .. $record_set->count() ) { 
    print $record_set->record( $_ )->name();
  }
  
  foreach ( $record_set->range_records( 11, 20 ) ) { 
    print $_->name();
  }

This package is not yet complete.

The base implementation of RecordSet is an array of Record references.

new()
  $class->new ( @records ) : $recordset
    

Array constructor.

clone()
  $recordset->clone() : $recordset
    

Create a shallow copy of the record set.

init()
  $recordset->init ( @records )
    

Array content setter.

records()
  $rs->records() : @records
    

Array content accessor.

count()
  $count = $rs->count();
    

Returns the number of records in this set.

record()
  $record = $rs->record( $position );
    

Return the record in the indicated position in the array. Returns nothing if position is undefined.

Indexes start with zero. Negative indexes are counted back from the end, with -1 being the last, -2 being the one before that, and so forth.

last_record
  $record = $rs->last_record();
    

Return the last record in the array.

range_set()
  $clone = $rs->range_set( $start_pos, $stop_pos );
    

Return a copy of the current set containing only those records at or between the start and stop positions.

range_records()
  @records = $rs->range_records( $start_pos, $stop_pos );
    

Return the records at or between the start and stop positions.

Use of these methods requires the Data::Sorting module from CPAN.

See Data::Sorting for more information.

sort()
  $rs->sort( @fieldnames );
    

Sort the contents of the set.

sorted_set()
  $clone = $rs->sorted_set( @fieldnames );
    

Return a sorted copy of the current set.

sorted_records()
  @records = $rs->sorted_records( @fieldnames );
    

Return the records from the current set, in sorted order.

Caution: This set of methods is currently not working.
filter()
  $rs->filter( $criteria );
    

Remove non-matching records from the set.

filtered_set()
  $clone = $rs->filtered_set( $criteria );
    

Return a set containing only the matching records from the current set.

filtered_records()
  @records = $rs->filtered_records( $criteria );
    

Return the matching records from the current set.

See DBIx::SQLEngine for the overall interface and developer documentation.

See DBIx::SQLEngine::Docs::ReadMe for general information about this distribution, including installation and license information.

2004-11-28 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.