This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class AppServiceProvider extends ServiceProvider | |
{ | |
/** | |
* Register any application services. | |
*/ | |
public function register(): void | |
{ | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public static function loadValidatorMetadata(ClassMetadata $metadata) | |
{ | |
$metadata->addPropertyConstraint('images', new Assert\Callback( | |
[ | |
'callback' => [static::class, 'validateImage'], | |
'groups' => ['product_product_images'] | |
] | |
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @param array $data | |
* @throws ProductImportException | |
*/ | |
public function createProduct(array $data) | |
{ | |
$originalProduct = $this->productRepository->findOneByCode($data['code']); |