예제 #1
0
 /**
  * @Transform /^"([^"]+)" product variant$/
  * @Transform /^"([^"]+)" variant$/
  * @Transform :variant
  */
 public function getProductVariantByName($name)
 {
     $productVariants = $this->productVariantRepository->findBy(['name' => $name]);
     Assert::eq(1, count($productVariants), sprintf('%d product variants has been found with name "%s".', count($productVariants), $name));
     return $productVariants[0];
 }