Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
SQLEngine::RecordSet::UserSContributed Perl DoSQLEngine::RecordSet::PKeySet(3)

NAME
       DBIx::SQLEngine::RecordSet::PKeySet - A RecordSet which holds primary
       keys

SYNOPSIS
	 use DBIx::SQLEngine::RecordSet;

	 $rs = DBIx::SQLEngine::RecordSet->class( 'PKeySet' )->new(@records);

DESCRIPTION
       Provides	additional methods for a RecordSet to store primary keys
       instead of references to	records.

       This package is INCOMPLETE!

   Class and IDs
       o   $rs = DBIx::SQLEngine::RecordSet::Set->new_class_ids( $class, @ids
	   );

       o   $rs->init_class_ids(	$class,	@ids );

       o   ( $class, @ids ) = $rs->class_ids();

   Conversions
       Each of the below returns a RecordSet blessed into a particular
       subclass. Returns the original object if	it is already of that
       subclass, or returns a cloned and converted copy.

       o   @data = $rs->raw();

	   Returns the contents	of the RecordSet as stored internally within
	   the object. Results are dependent on	which subclass is in use.

       o   $rs = $rs->as_RecordArray;

	   INCOMPLETE

       o   $clone = $rs->as_IDArray;

	   INCOMPLETE

       o   $clone = $rs->as_IDString;

	   INCOMPLETE

       # $rs = DBIx::SQLEngine::RecordSet::Set->new_class_ids( $class, @ids );
       sub new_ids {
	 my $callee = shift;
	 my $package = ref $callee || $callee;

	 my $self = [];
	 bless $self, $package;
	 $self->init_class_ids(	@_ );
	 return	$self;
       }

       # $rs->init_ids(	$class,	@ids );	sub init_ids {
	 my $self = shift;
	 my $class = shift;

	 @$self	= map {	$class->fetch_id( $_ ) } @_;
       }

       # @records = $rs->class_ids(); sub class_ids {
	 my $self = shift;
	 my $class = ref( $self->[0] );
	 return	$class,	map { $_->{id} } @$self; }

       ###

       sub raw {
	 my $self = shift;
	 if ( scalar @_	) {
	   @$self = @_;
	 } else	{
	   @$self;
	 } } # # sub as_RecordArray { #	  my $self = shift; # }	# # sub
       as_IDArray { #	my $self = shift; #
       EBiz::Database::RecordSet::IDArray->new(	$self->records ); # } #	# sub
       as_IDString { #	 my $self = shift; #
       EBiz::Database::RecordSet::IDString->new( $self->records	); # }

       ########################################################################

       ########################################################################

SEE ALSO
       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.

perl v5.24.1			  2004-11-29  SQLEngine::RecordSet::PKeySet(3)

NAME | SYNOPSIS | DESCRIPTION | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=DBIx::SQLEngine::RecordSet::PKeySet&sektion=3&manpath=FreeBSD+12.1-RELEASE+and+Ports>

home | help