|
- <?php
-
- namespace common\logic\Payment\Repository;
-
- use common\logic\AbstractRepository;
- use common\logic\Order\Order\Model\Order;
- use common\logic\Payment\Model\Payment;
-
- class PaymentRepository extends AbstractRepository
- {
- protected PaymentRepositoryQuery $query;
-
- public function loadDependencies(): void
- {
- $this->loadQuery(PaymentRepositoryQuery::class);
- }
-
- public function getDefaultOptionsSearch(): array
- {
- return [
- self::WITH => [
- 'user'
- ],
- self::JOIN_WITH => [],
- self::ORDER_BY => Payment::tableName() . '.date ASc',
- self::ATTRIBUTE_ID_PRODUCER => Payment::tableName() . '.id_producer'
- ];
- }
-
- public function getByOrder(Order $order)
- {
- return $this->createDefaultQuery()
- ->filterByOrder($order)
- ->find();
- }
- }
|