-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RefundPayment] Change order number to Order relation on RefundPayment #307
Changes from all commits
91173ec
eee327c
d278a5d
545d719
8a526ab
f464e20
371a21c
4b25791
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sylius package. | ||
* | ||
* (c) Paweł Jędrzejewski | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Sylius\RefundPlugin\Doctrine\ORM; | ||
|
||
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository; | ||
use Sylius\RefundPlugin\Repository\RefundPaymentRepositoryInterface; | ||
|
||
class RefundPaymentRepository extends EntityRepository implements RefundPaymentRepositoryInterface | ||
{ | ||
public function findByOrderNumber(string $orderNumber): array | ||
{ | ||
return $this->createQueryBuilder('o') | ||
->innerJoin('o.order', 'ord') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup, that is the reason 😃 And to be honest, it is a copy-pasted shortcut from Sylius, but I agree that |
||
->andWhere('ord.number = :orderNumber') | ||
->setParameter('orderNumber', $orderNumber) | ||
->getQuery() | ||
->getResult() | ||
; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we (similar to factories) provide trait that should be implemented in the repository? But I suppose it's not a case for this change but for all the repositories and plugin 💃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so, but this is the plugin, that defines RefundPayment, so creating a repository without traits makes sense here.