write work, no tests
This commit is contained in:
parent
54ed6f7e9e
commit
e0089f37f8
1 changed files with 7 additions and 1 deletions
|
|
@ -2346,8 +2346,14 @@ sub write {
|
||||||
##Get list of classes
|
##Get list of classes
|
||||||
##Get properties for only that class
|
##Get properties for only that class
|
||||||
##Write them to the db.
|
##Write them to the db.
|
||||||
|
my $db = $self->session->db;
|
||||||
CLASS: foreach my $meta (reverse $self->meta->get_all_class_metas()) {
|
CLASS: foreach my $meta (reverse $self->meta->get_all_class_metas()) {
|
||||||
my $table = $meta->tableName;
|
my $table = $db->quote_identifier($meta->tableName);
|
||||||
|
my @properties = $meta->get_property_list;
|
||||||
|
my @values = map { $self->$_ } @properties;
|
||||||
|
my @columnNames = map { $db->quote_identifier($_).'=?' } @properties;
|
||||||
|
push @values, $self->getId, $self->revisionDate;
|
||||||
|
$db->write("update ".$table." set ".join(",",@columnNames)." where assetId=? and revisionDate=?",\@values);
|
||||||
}
|
}
|
||||||
|
|
||||||
# we've changed something so we need to update our size
|
# we've changed something so we need to update our size
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue