Class::DBI::Attribute - A value in a column.


Class-DBI documentation Contained in the Class-DBI distribution.

Index


Code Index:

NAME

Top

Class::DBI::Attribute - A value in a column.

SYNOPSIS

Top

	my $column = Class::DBI::Attribute->new($column => $value);

DESCRIPTION

Top

This stores the row-value of a certain column in an object. You probably shouldn't be dealing with this directly, and its interface is liable to change without notice.

METHODS

Top


Class-DBI documentation Contained in the Class-DBI distribution.

package Class::DBI::Attribute;

use strict;
use base 'Class::Accessor::Fast';

__PACKAGE__->mk_accessors(qw/column current_value known/);

use overload
	'""' => sub { shift->current_value },
	fallback => 1;

sub new {
	my ($class, $col, $val) = @_;
	$class->SUPER::new({ 
		column => $col, current_value => $val, known => 1,
	});
}

1;