| Total Complexity | 4 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Coverage | 42.86% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | trait HasSubscriptionLastReview |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var null|Product |
||
| 16 | * |
||
| 17 | * @ORM\ManyToOne(targetEntity="Product") |
||
| 18 | * @ORM\JoinColumns({ |
||
| 19 | * @ORM\JoinColumn(nullable=true, onDelete="SET NULL") |
||
| 20 | * }) |
||
| 21 | */ |
||
| 22 | private $subscriptionLastReview; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Get last review number available through a subscription, bypassing all ACL so it also work even if review is not active yet |
||
| 26 | */ |
||
| 27 | 2 | public function getSubscriptionLastReviewNumber(): ?int |
|
| 28 | { |
||
| 29 | /** @var ProductRepository $productRepository */ |
||
| 30 | 2 | $productRepository = _em()->getRepository(Product::class); |
|
| 31 | |||
| 32 | 2 | return $productRepository->getSubscriptionLastReviewNumber($this); |
|
|
1 ignored issue
–
show
|
|||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Set last review available through a subscription |
||
| 37 | * |
||
| 38 | * @API\Exclude |
||
| 39 | */ |
||
| 40 | public function setSubscriptionLastReview(?Product $subscriptionLastReview): void |
||
| 47 | } |
||
| 48 | } |
||
| 49 |