Vous ne pouvez pas sélectionner plus de 25 sujets
Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
|
- <?php
-
- namespace domain\Payment;
-
- use domain\Order\Order\Order;
- use domain\User\User\User;
- use domain\_\AbstractRepositoryQuery;
-
- class PaymentRepositoryQuery extends AbstractRepositoryQuery
- {
- protected PaymentDefinition $definition;
-
- public function loadDependencies(): void
- {
- $this->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;
- }
- }
|