1 | <?php |
||
20 | final class ProductContext implements Context |
||
21 | { |
||
22 | /** |
||
23 | * @var RepositoryInterface |
||
24 | */ |
||
25 | private $productRepository; |
||
26 | |||
27 | /** |
||
28 | * @var RepositoryInterface |
||
29 | */ |
||
30 | private $productVariantRepository; |
||
31 | |||
32 | /** |
||
33 | * @param RepositoryInterface $productRepository |
||
34 | * @param RepositoryInterface $productVariantRepository |
||
35 | */ |
||
36 | public function __construct(RepositoryInterface $productRepository, RepositoryInterface $productVariantRepository) |
||
41 | |||
42 | /** |
||
43 | * @Transform /^product "([^"]+)"$/ |
||
44 | * @Transform /^"([^"]+)" product$/ |
||
45 | * @Transform :product |
||
46 | */ |
||
47 | public function getProductByName($productName) |
||
56 | |||
57 | /** |
||
58 | * @Transform /^"([^"]+)" variant of product "([^"]+)"$/ |
||
59 | */ |
||
60 | public function getProductVariantByNameAndProduct($variantName, $productName) |
||
71 | } |
||
72 |