Fix problems with Moose style object creation.

This commit is contained in:
Colin Kuskie 2010-07-07 12:31:37 -07:00
parent e5a2af0330
commit 416f62f36a
2 changed files with 23 additions and 3 deletions

View file

@ -50,12 +50,12 @@ around BUILDARGS => sub {
##Need same db code as below here.
##Session check goes here?
##Build a new one
my $session = $_[0]->{session};
my $properties = $_[0];
my $session = $properties->{session};
if (! (blessed $session && $session->isa('WebGUI::Session')) ) {
WebGUI::Error::InvalidObject->throw(expected=>"WebGUI::Session", got=>(ref $session), error=>"Need a session.");
}
my ($vendorId, $dateCreated) = $class->_init($session);
my $properties = {};
$properties->{vendorId} = $vendorId;
$properties->{dateCreated} = $dateCreated;
return $class->$orig($properties);