loadQuery(PaymentRepositoryQuery::class); } public function getDefaultOptionsSearch(): array { return [ self::WITH => [ 'user', 'order', 'userAction' ], 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(); } public function queryPaymentsCreditHistoryByUser(User $user) { return $this->createDefaultQuery() ->filterByUser($user) ->filterIsCredit() ->orderBy('date DESC'); } public function findPaymentsCreditHistoryByUser(User $user): array { return $this->queryPaymentsCreditHistoryByUser($user)->find(); } }