app\models\Activity::getMessage PHP Method

getMessage() public method

public getMessage ( ) : mixed
return mixed
    public function getMessage()
    {
        $activityTypeId = $this->activity_type_id;
        $account = $this->account;
        $client = $this->client;
        $user = $this->user;
        $invoice = $this->invoice;
        $contactId = $this->contact_id;
        $payment = $this->payment;
        $credit = $this->credit;
        $expense = $this->expense;
        $isSystem = $this->is_system;
        $task = $this->task;
        $data = ['client' => $client ? link_to($client->getRoute(), $client->getDisplayName()) : null, 'user' => $isSystem ? '<i>' . trans('texts.system') . '</i>' : $user->getDisplayName(), 'invoice' => $invoice ? link_to($invoice->getRoute(), $invoice->getDisplayName()) : null, 'quote' => $invoice ? link_to($invoice->getRoute(), $invoice->getDisplayName()) : null, 'contact' => $contactId ? $client->getDisplayName() : $user->getDisplayName(), 'payment' => $payment ? $payment->transaction_reference : null, 'payment_amount' => $payment ? $account->formatMoney($payment->amount, $payment) : null, 'adjustment' => $this->adjustment ? $account->formatMoney($this->adjustment, $this) : null, 'credit' => $credit ? $account->formatMoney($credit->amount, $client) : null, 'task' => $task ? link_to($task->getRoute(), substr($task->description, 0, 30) . '...') : null, 'expense' => $expense ? link_to($expense->getRoute(), substr($expense->public_notes, 0, 30) . '...') : null];
        return trans("texts.activity_{$activityTypeId}", $data);
    }