diff --git a/lib/GaletteObjectsLend/Repository/Objects.php b/lib/GaletteObjectsLend/Repository/Objects.php index 1adc2ec..0899772 100644 --- a/lib/GaletteObjectsLend/Repository/Objects.php +++ b/lib/GaletteObjectsLend/Repository/Objects.php @@ -183,6 +183,14 @@ public function removeObjects(array $ids) try { $this->zdb->connection->beginTransaction(); + $update = $this->zdb->update(LEND_PREFIX . self::TABLE); + $update->set(['rent_id' => null]); + $update->where->in( + self::PK, + $ids + ); + $this->zdb->execute($update); + $delete = $this->zdb->delete(LEND_PREFIX . LendRent::TABLE); $delete->where->in( self::PK,