Nie możesz wybrać więcej, niż 25 tematów
Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
|
- <?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;
- }
- }
|