Skip to content

Commit

Permalink
Small simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
flack committed Jul 15, 2024
1 parent 8bbdf44 commit 6cccb47
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/org/openpsa/invoices/midcom/interfaces.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ public function resolve_object_link(midcom_db_topic $topic, midcom_core_dbaobjec
public function _on_watched_dba_delete(midcom_core_dbaobject $object)
{
midcom::get()->auth->request_sudo($this->_component);
$qb_billing_data = org_openpsa_invoices_billing_data_dba::new_query_builder();
$qb_billing_data->add_constraint('linkGuid', '=', $object->guid);
$result = $qb_billing_data->execute();
foreach ($result as $billing_data) {
$qb = org_openpsa_invoices_billing_data_dba::new_query_builder();
$qb->add_constraint('linkGuid', '=', $object->guid);
foreach ($qb->execute() as $billing_data) {
debug_add("Delete billing data with guid:" . $billing_data->guid . " for object with guid:" . $object->guid);
$billing_data->delete();
}
Expand Down

0 comments on commit 6cccb47

Please sign in to comment.