-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to choose which product to import on webhook (#194)
- Loading branch information
Showing
6 changed files
with
241 additions
and
30 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Webgriffe\SyliusAkeneoPlugin\Event; | ||
|
||
/** | ||
* @psalm-type AkeneoEventProduct = array{ | ||
* uuid: string, | ||
* identifier: string, | ||
* enabled: bool, | ||
* family: ?string, | ||
* categories: string[], | ||
* groups: string[], | ||
* parent: ?string, | ||
* values: array<string, array>, | ||
* created: string, | ||
* updated: string, | ||
* associations: array<string, array>, | ||
* quantified_associations: array<string, array>, | ||
* } | ||
* @psalm-type AkeneoEvent = array{ | ||
* action: string, | ||
* event_id: string, | ||
* event_datetime: string, | ||
* author: string, | ||
* author_type: string, | ||
* pim_source: string, | ||
* data: array{ | ||
* resource: AkeneoEventProduct|array | ||
* }, | ||
* } | ||
*/ | ||
final class AkeneoProductChangedEvent | ||
{ | ||
private bool $ignorable = false; | ||
|
||
/** | ||
* @param AkeneoEventProduct $akeneoProduct | ||
* @param AkeneoEvent $akeneoEvent | ||
*/ | ||
public function __construct( | ||
private array $akeneoProduct, | ||
private array $akeneoEvent, | ||
) { | ||
} | ||
|
||
public function getAkeneoProduct(): array | ||
{ | ||
return $this->akeneoProduct; | ||
} | ||
|
||
public function getAkeneoEvent(): array | ||
{ | ||
return $this->akeneoEvent; | ||
} | ||
|
||
public function isIgnorable(): bool | ||
{ | ||
return $this->ignorable; | ||
} | ||
|
||
public function setIgnorable(bool $ignorable): void | ||
{ | ||
$this->ignorable = $ignorable; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Webgriffe\SyliusAkeneoPlugin\Event; | ||
|
||
/** | ||
* @psalm-type AkeneoEventProductModel = array{ | ||
* code: string, | ||
* family: string, | ||
* family_variant: string, | ||
* parent: ?string, | ||
* categories: string[], | ||
* values: array<string, array>, | ||
* created: string, | ||
* updated: string, | ||
* associations: array<string, array>, | ||
* quantified_associations: array<string, array>, | ||
* } | ||
* @psalm-type AkeneoEvent = array{ | ||
* action: string, | ||
* event_id: string, | ||
* event_datetime: string, | ||
* author: string, | ||
* author_type: string, | ||
* pim_source: string, | ||
* data: array{ | ||
* resource: array|AkeneoEventProductModel | ||
* }, | ||
* } | ||
*/ | ||
final class AkeneoProductModelChangedEvent | ||
{ | ||
private bool $ignorable = false; | ||
|
||
/** | ||
* @param AkeneoEventProductModel $akeneoProductModel | ||
* @param AkeneoEvent $akeneoEvent | ||
*/ | ||
public function __construct( | ||
private array $akeneoProductModel, | ||
private array $akeneoEvent, | ||
) { | ||
} | ||
|
||
public function getAkeneoProductModel(): array | ||
{ | ||
return $this->akeneoProductModel; | ||
} | ||
|
||
public function getAkeneoEvent(): array | ||
{ | ||
return $this->akeneoEvent; | ||
} | ||
|
||
public function isIgnorable(): bool | ||
{ | ||
return $this->ignorable; | ||
} | ||
|
||
public function setIgnorable(bool $ignorable): void | ||
{ | ||
$this->ignorable = $ignorable; | ||
} | ||
} |