label is already stored in the options, and never used directly in any method. Code that wants it can instanciate an object

This commit is contained in:
Colin Kuskie 2008-02-22 19:08:32 +00:00
parent ac28252d53
commit 72177f762c
3 changed files with 21 additions and 1 deletions

View file

@ -83,7 +83,6 @@ The following fields are needed to construct this object's table called "shipper
Field Schema Description
shipperId guid The unique id for this shipper.
label varchar(100) A title for this shipper that will be displayed to the user. For example "Flat Rate" or "FedEx Overnight"
className varchar(255) The plugin classname that will be used for this shipping module.
options mediumtext A json serialized hash reference with configuration data for this shipper.

View file

@ -25,6 +25,7 @@ my $session = start(); # this line required
# upgrade functions go here
insertCommerceTaxTable($session);
insertCommerceShipDriverTable($session);
migrateToNewCart($session);
finish($session); # this line required
@ -71,6 +72,23 @@ EOSQL
}
#-------------------------------------------------
sub insertCommerceShipDriverTable {
my $session = shift;
print "\tInstall the Commerce ShipperDriver Table.\n" unless ($quiet);
# and here's our code
$session->db->write(<<EOSQL);
CREATE TABLE shipper (
shipperId VARCHAR(22) binary NOT NULL,
className VARCHAR(255),
options mediumtext,
PRIMARY KEY (shipperId)
)
EOSQL
}
# --------------- DO NOT EDIT BELOW THIS LINE --------------------------------

View file

@ -78,6 +78,9 @@ sub create {
$options{ $id } = $options;
$className{ $id } = __PACKAGE__;
$session->db->write('insert into shipper (shipperId,className) VALUES (?,?)', [$shipperId, $className{$id}]);
#$self->set($options);
return $self;
}