NAME
Class::DBI::TempEssential - CDBI extension for temporary essentials
SYNOPSIS
# $cdbi_table ISA Class::DBI table
my
@new_essential
=
qw/col1 col5 col7/
;
my
$tempEssential
= new Class::DBI::TempEssential(
$cdbi_table
,
@new_essential
);
# do what you want to do with this essential setting
undef
$tempEssential
;
# or get out of my-scope
# you have your old setting back
DESCRIPTION
TempEssential modifies the Essential columns of a Class::DBI table. It reverts the original Essential columns when getting out of scope.
FUNCTIONS
- new
-
ARGS: $cdbi-class, @essential_columns RETURNS: $self
- set_essential ARGS: $self, @essential_columns RETURNS: @old_essential_columns
-
change the essential columns again
- reset_essential ARGS: $self RETURNS: @old_essential_columns
-
revert the essential columns to the original one
EXPORT
None by default.
BUGS / CAVEATS
When using several temp-essential columns on the same class on the same time, the user has to make sure, that the destruction work in reverse order to construction, i.e.
my
$tmp1
= new Class::DBI::TempEssential(
$cdbi_table
,
@new_essential1
);
my
$tmp2
= new Class::DBI::TempEssential(
$cdbi_table
,
@new_essential2
);
...
undef
$tmp2
;
undef
$tmp1
;
In particular:
my
$tmp
= new Class::DBI::TempEssential(
$cdbi_table
,
@new_essential1
);
undef
$tmp
;
# important since perl will use different distruction order
$tmp
= new Class::DBI::TempEssential(
$cdbi_table
,
@new_essential2
);
AUTHOR
H. Klein, <H.Klein@gmx.net>
SEE ALSO
perl.