loadDefinition(PaymentDefinition::class); } public function filterByOrder(Order $order): self { $this->andWhere(['id_order' => $order->id]); return $this; } public function filterByUser(User $user): self { $this->andWhere(['id_user' => $user->id]); return $this; } public function filterIsCredit() { $this->andWhere("payment.type = 'initial-credit' OR payment.type = 'credit' OR payment.type = 'debit' OR (payment.type = 'payment' AND payment.mean_payment = 'credit') OR (payment.type = 'refund' AND payment.mean_payment = 'credit')"); return $this; } }