Fix problems with Moose style object creation.
This commit is contained in:
parent
e5a2af0330
commit
416f62f36a
2 changed files with 23 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue