App\Ninja\Transformers\PaymentTransformer::transform PHP Method

transform() public method

public transform ( Payment $payment )
$payment app\models\Payment
    public function transform(Payment $payment)
    {
        return array_merge($this->getDefaults($payment), ['id' => (int) $payment->public_id, 'amount' => (double) $payment->amount, 'transaction_reference' => $payment->transaction_reference, 'payment_date' => $payment->payment_date, 'updated_at' => $this->getTimestamp($payment->updated_at), 'archived_at' => $this->getTimestamp($payment->deleted_at), 'is_deleted' => (bool) $payment->is_deleted, 'payment_type_id' => (int) $payment->payment_type_id, 'invoice_id' => (int) ($this->invoice ? $this->invoice->public_id : $payment->invoice->public_id), 'invoice_number' => $this->invoice ? $this->invoice->invoice_number : $payment->invoice->invoice_number]);
    }