1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

fixes for event listeners

This commit is contained in:
David Bomba 2021-05-11 15:17:45 +10:00
parent 4ccf6fcbcc
commit f19af6290a
37 changed files with 37 additions and 38 deletions

View File

@ -52,8 +52,7 @@ class QueryLogging
$timeEnd = microtime(true);
$time = $timeEnd - $timeStart;
nlog($request->method().' - '.urldecode($request->url()).": $count queries - ".$time);
//nlog($request->method().' - '.urldecode($request->url()).": $count queries - ".$time);
// if($count > 50)
//nlog($queries);

View File

@ -43,7 +43,7 @@ class ArchivedClientActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->client->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->client->user_id;
$fields->client_id = $event->client->id;
$fields->user_id = $user_id;

View File

@ -45,7 +45,7 @@ class ClientUpdatedActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->client->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->client->user_id;
$fields->client_id = $client->id;
$fields->user_id = $user_id;

View File

@ -43,7 +43,7 @@ class CreatedClientActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->client->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->client->user_id;
$fields->client_id = $event->client->id;
$fields->user_id = $user_id;

View File

@ -43,7 +43,7 @@ class CreatedCreditActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->credit->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->credit->user_id;
$fields->credit_id = $event->credit->id;
$fields->user_id = $user_id;

View File

@ -44,7 +44,7 @@ class CreatedExpenseActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->expense->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->expense->user_id;
$fields->expense_id = $event->expense->id;
$fields->user_id = $user_id;

View File

@ -43,7 +43,7 @@ class CreatedQuoteActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->quote->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->quote->user_id;
$fields->quote_id = $event->quote->id;
$fields->client_id = $event->quote->client_id;

View File

@ -43,7 +43,7 @@ class CreatedSubscriptionActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->subscription->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->subscription->user_id;
$fields->subscription_id = $event->subscription->id;
$fields->user_id = $user_id;

View File

@ -43,7 +43,7 @@ class CreatedTaskActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->task->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->task->user_id;
$fields->task_id = $event->task->id;
$fields->user_id = $user_id;

View File

@ -43,7 +43,7 @@ class CreatedVendorActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->vendor->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->vendor->user_id;
$fields->vendor_id = $event->vendor->id;
$fields->user_id = $user_id;

View File

@ -43,7 +43,7 @@ class CreditArchivedActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->credit->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->credit->user_id;
$fields->payment_id = $event->credit->id;
$fields->client_id = $event->credit->client_id;

View File

@ -43,7 +43,7 @@ class DeleteClientActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->client->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->client->user_id;
$fields->client_id = $event->client->id;
$fields->user_id = $user_id;

View File

@ -43,7 +43,7 @@ class DeleteCreditActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->credit->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->credit->user_id;
$fields->client_id = $event->credit->client_id;
$fields->credit_id = $event->credit->id;

View File

@ -45,7 +45,7 @@ class ExpenseArchivedActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->expense->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->expense->user_id;
$fields->expense_id = $expense->id;
$fields->user_id = $user_id;

View File

@ -43,7 +43,7 @@ class ExpenseDeletedActivity implements ShouldQueue
$fields = new stdClass;
$user_id = array_key_exists('user_id', $event->event_vars['user_id']) ? $event->event_vars['user_id'] : $event->expense->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->expense->user_id;
$fields->expense_id = $event->expense->id;
$fields->user_id = $user_id;

View File

@ -43,7 +43,7 @@ class ExpenseRestoredActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->expense->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->expense->user_id;
$fields->expense_id = $event->expense->id;
$fields->user_id = $user_id;

View File

@ -43,7 +43,7 @@ class ExpenseUpdatedActivity implements ShouldQueue
$expense = $event->expense;
$user_id = $event->event_vars['user_id'] ?: $event->expense->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->expense->user_id;
$fields = new stdClass;

View File

@ -48,7 +48,7 @@ class PaymentArchivedActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->payment->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->payment->user_id;
$fields->payment_id = $payment->id;
$fields->client_id = $payment->client_id;

View File

@ -43,7 +43,7 @@ class PaymentCreatedActivity implements ShouldQueue
$payment = $event->payment;
$user_id = $event->event_vars['user_id'] ?: $event->payment->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->payment->user_id;
$invoices = $payment->invoices;

View File

@ -43,7 +43,7 @@ class PaymentDeletedActivity implements ShouldQueue
$payment = $event->payment;
$user_id = $event->event_vars['user_id'] ?: $event->payment->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->payment->user_id;
$invoices = $payment->invoices;

View File

@ -43,7 +43,7 @@ class PaymentRefundedActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->payment->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->payment->user_id;
$fields->client_id = $event->payment->id;
$fields->client_id = $event->payment->client_id;

View File

@ -48,7 +48,7 @@ class PaymentUpdatedActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->payment->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->payment->user_id;
$fields->payment_id = $payment->id;
$fields->client_id = $payment->client_id;

View File

@ -43,7 +43,7 @@ class PaymentVoidedActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->payment->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->payment->user_id;
$fields->client_id = $event->payment->id;
$fields->user_id = $user_id;

View File

@ -45,7 +45,7 @@ class QuoteUpdatedActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->quote->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->quote->user_id;
$fields->quote_id = $quote->id;
$fields->client_id = $quote->client_id;

View File

@ -43,7 +43,7 @@ class RestoreClientActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->client->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->client->user_id;
$fields->client_id = $event->client->id;
$fields->user_id = $user_id;

View File

@ -45,7 +45,7 @@ class SubscriptionArchivedActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->subscription->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->subscription->user_id;
$fields->subscription_id = $subscription->id;
$fields->user_id = $user_id;

View File

@ -43,7 +43,7 @@ class SubscriptionDeletedActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->subscription->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->subscription->user_id;
$fields->subscription_id = $event->subscription->id;
$fields->user_id = $user_id;

View File

@ -43,7 +43,7 @@ class SubscriptionRestoredActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->subscription->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->subscription->user_id;
$fields->subscription_id = $event->subscription->id;
$fields->user_id = $user_id;

View File

@ -45,7 +45,7 @@ class SubscriptionUpdatedActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->subscription->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->subscription->user_id;
$fields->subscription_id = $subscription->id;
$fields->user_id = $user_id;

View File

@ -45,7 +45,7 @@ class TaskArchivedActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->task->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->task->user_id;
$fields->task_id = $task->id;
$fields->user_id = $user_id;

View File

@ -43,7 +43,7 @@ class TaskRestoredActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->task->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->task->user_id;
$fields->task_id = $event->task->id;
$fields->user_id = $user_id;

View File

@ -45,7 +45,7 @@ class TaskUpdatedActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->task->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->task->user_id;
$fields->task_id = $task->id;
$fields->user_id = $user_id;

View File

@ -43,7 +43,7 @@ class UpdatedCreditActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->credit->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->credit->user_id;
$fields->credit_id = $event->credit->id;
$fields->client_id = $event->credit->client_id;

View File

@ -45,7 +45,7 @@ class VendorArchivedActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->vendor->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->vendor->user_id;
$fields->vendor_id = $vendor->id;
$fields->user_id = $user_id;

View File

@ -43,7 +43,7 @@ class VendorDeletedActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->vendor->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->vendor->user_id;
$fields->vendor_id = $event->vendor->id;
$fields->user_id = $user_id;

View File

@ -43,7 +43,7 @@ class VendorRestoredActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->vendor->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->vendor->user_id;
$fields->vendor_id = $event->vendor->id;
$fields->user_id = $user_id;

View File

@ -45,7 +45,7 @@ class VendorUpdatedActivity implements ShouldQueue
$fields = new stdClass;
$user_id = $event->event_vars['user_id'] ?: $event->vendor->user_id;
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->vendor->user_id;
$fields->vendor_id = $vendor->id;
$fields->user_id = $user_id;