Update technical data on HD substitution

This commit is contained in:
Romain Neutron
2014-02-28 12:57:42 +01:00
parent 23a438c210
commit af9259d0cc
2 changed files with 7 additions and 1 deletions

View File

@@ -1371,7 +1371,12 @@ class record_adapter implements record_Interface, cache_cacheableInterface
return $this;
}
$sql = 'REPLACE INTO technical_datas (id, record_id, name, value)
$sql = 'DELETE FROM technical_datas WHERE record_id = :record_id';
$stmt = $this->get_databox()->get_connection()->prepare($sql);
$stmt->execute(array(':record_id' => $this->get_record_id()));
$stmt->closeCursor();
$sql = 'INSERT INTO technical_datas (id, record_id, name, value)
VALUES (null, :record_id, :name, :value)';
$stmt = $this->get_databox()->get_connection()->prepare($sql);