loadQuery(InvoiceRepositoryQuery::class); } public function getDefaultOptionsSearch(): array { return [ self::WITH => ['payments'], self::JOIN_WITH => ['user AS user_invoice', 'producer'], self::ORDER_BY => 'date ASC', self::ATTRIBUTE_ID_PRODUCER => 'invoice.id_producer' ]; } public function findOneInvoiceById(int $id): ?Invoice { return $this->createDefaultQuery() ->filterById($id) ->findOne(); } }