1 | <?php |
||
2 | |||
3 | /** |
||
4 | * Copyright © 2016-present Spryker Systems GmbH. All rights reserved. |
||
5 | * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. |
||
6 | */ |
||
7 | |||
8 | namespace Spryker\Zed\AssetStorage\Communication\Plugin\Event\Listener; |
||
9 | |||
10 | use Spryker\Shared\Kernel\Transfer\TransferInterface; |
||
11 | use Spryker\Zed\AssetStorage\AssetStorageConfig; |
||
12 | use Spryker\Zed\AssetStorage\Communication\Exception\NoForeignKeyException; |
||
13 | use Spryker\Zed\Event\Dependency\Plugin\EventHandlerInterface; |
||
14 | use Spryker\Zed\Kernel\Communication\AbstractPlugin; |
||
15 | |||
16 | /** |
||
17 | * @deprecated Use {@link \Spryker\Zed\AssetStorage\Communication\Plugin\Publisher\Asset\AssetWritePublisherPlugin} instead. |
||
18 | * |
||
19 | * @method \Spryker\Zed\AssetStorage\Business\AssetStorageFacadeInterface getFacade() |
||
20 | * @method \Spryker\Zed\AssetStorage\AssetStorageConfig getConfig() |
||
21 | * @method \Spryker\Zed\AssetStorage\Communication\AssetStorageCommunicationFactory getFactory() |
||
22 | */ |
||
23 | class AssetStoreStoragePublishListener extends AbstractPlugin implements EventHandlerInterface |
||
24 | { |
||
25 | /** |
||
26 | * @param \Generated\Shared\Transfer\EventEntityTransfer $eventEntityTransfer |
||
27 | * @param string $eventName |
||
28 | * |
||
29 | * @throws \Spryker\Zed\AssetStorage\Communication\Exception\NoForeignKeyException |
||
30 | * |
||
31 | * @return void |
||
32 | */ |
||
33 | public function handle(TransferInterface $eventEntityTransfer, $eventName) |
||
34 | { |
||
35 | $foreignKeys = $eventEntityTransfer->getForeignKeys(); |
||
0 ignored issues
–
show
|
|||
36 | |||
37 | if (!isset($foreignKeys[AssetStorageConfig::COL_FK_ASSET])) { |
||
38 | throw new NoForeignKeyException(AssetStorageConfig::COL_FK_ASSET); |
||
39 | } |
||
40 | if (!isset($foreignKeys[AssetStorageConfig::COL_FK_STORE])) { |
||
41 | throw new NoForeignKeyException(AssetStorageConfig::COL_FK_STORE); |
||
42 | } |
||
43 | |||
44 | $idAsset = $foreignKeys[AssetStorageConfig::COL_FK_ASSET]; |
||
45 | $idStore = $foreignKeys[AssetStorageConfig::COL_FK_STORE]; |
||
46 | |||
47 | $this->getFacade()->publishStoreRelation($idAsset, $idStore); |
||
48 | } |
||
49 | } |
||
50 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.