-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SPRY-3032 Rename CacheManagerGui namespace to CacheManager in CacheMa…
…nager model and related classes.
- Loading branch information
Showing
11 changed files
with
177 additions
and
75 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
src/ValanticSpryker/Zed/CacheManager/Business/CacheManagerBusinessFactory.php
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,49 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace ValanticSpryker\Zed\CacheManager\Business; | ||
|
||
use Spryker\Client\Storage\StorageClientInterface; | ||
use Spryker\Zed\Kernel\Business\AbstractBusinessFactory; | ||
use ValanticSpryker\Zed\CacheManager\Business\Model\CacheManager; | ||
use ValanticSpryker\Zed\CacheManager\CacheManagerDependencyProvider; | ||
use ValanticSpryker\Zed\CacheManager\Communication\Plugin\CacheManagerPluginCollection; | ||
|
||
class CacheManagerBusinessFactory extends AbstractBusinessFactory | ||
{ | ||
/** | ||
* @return \ValanticSpryker\Zed\CacheManager\Business\Model\CacheManager | ||
*/ | ||
public function createCacheManager(): CacheManager | ||
{ | ||
return new CacheManager( | ||
$this->createCacheManagerPluginCollection(), | ||
$this->getStorageClient(), | ||
); | ||
} | ||
|
||
/** | ||
* @return \ValanticSpryker\Zed\CacheManager\Communication\Plugin\CacheManagerPluginCollection | ||
*/ | ||
protected function createCacheManagerPluginCollection(): CacheManagerPluginCollection | ||
{ | ||
return new CacheManagerPluginCollection($this->getCacheManagerPlugins()); | ||
} | ||
|
||
/** | ||
* @return array<\ValanticSpryker\Zed\CacheManager\Communication\Plugin\CacheManagerPluginInterface> | ||
*/ | ||
protected function getCacheManagerPlugins(): array | ||
{ | ||
return $this->getProvidedDependency(CacheManagerDependencyProvider::CACHE_MANAGER_PLUGINS); | ||
} | ||
|
||
/** | ||
* @return \Spryker\Client\Storage\StorageClientInterface | ||
*/ | ||
protected function getStorageClient(): StorageClientInterface | ||
{ | ||
return $this->getProvidedDependency(CacheManagerDependencyProvider::CLIENT_STORAGE); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/ValanticSpryker/Zed/CacheManager/Business/CacheManagerFacade.php
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,31 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace ValanticSpryker\Zed\CacheManager\Business; | ||
|
||
use ValanticSpryker\Zed\CacheManager\Business\CacheManagerFacadeInterface; | ||
|
||
/** | ||
* @method \ValanticSpryker\Zed\CacheManager\Business\CacheManagerBusinessFactory getFactory() | ||
*/ | ||
class CacheManagerFacade extends AbstractFacade implements CacheManagerFacadeInterface | ||
{ | ||
/** | ||
* @return array<\Generated\Shared\Transfer\CacheManagerPluginTransfer> | ||
*/ | ||
public function getCacheManagerPluginsData(): array | ||
{ | ||
return $this->getFactory()->createCacheManager()->getPlugins(); | ||
} | ||
|
||
/** | ||
* @param \Generated\Shared\Transfer\CacheManagerDeleteTransfer $cacheManagerDeleteTransfer | ||
* | ||
* @return \Generated\Shared\Transfer\CacheManagerDeleteTransfer | ||
*/ | ||
public function deleteCache(CacheManagerDeleteTransfer $cacheManagerDeleteTransfer): CacheManagerDeleteTransfer | ||
{ | ||
return $this->getFactory()->createCacheManager()->deleteCache($cacheManagerDeleteTransfer); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/ValanticSpryker/Zed/CacheManager/Business/CacheManagerFacadeInterface.php
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,10 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace ValanticSpryker\Zed\CacheManager\Business; | ||
|
||
interface CacheManagerFacadeInterface | ||
{ | ||
|
||
} |
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
63 changes: 63 additions & 0 deletions
63
src/ValanticSpryker/Zed/CacheManager/CacheManagerDependencyProvider.php
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,63 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace ValanticSpryker\Zed\CacheManager; | ||
|
||
use Spryker\Client\Storage\StorageClientInterface; | ||
use Spryker\Zed\Kernel\AbstractBundleDependencyProvider; | ||
use Spryker\Zed\Kernel\Container; | ||
|
||
class CacheManagerDependencyProvider extends AbstractBundleDependencyProvider | ||
{ | ||
public const CACHE_MANAGER_PLUGINS = 'CACHE_MANAGER_PLUGINS'; | ||
public const CLIENT_STORAGE = 'CLIENT_STORAGE'; | ||
|
||
/** | ||
* @param \Spryker\Zed\Kernel\Container $container | ||
* | ||
* @return \Spryker\Zed\Kernel\Container | ||
*/ | ||
public function provideBusinessLayerDependencies(Container $container): Container | ||
{ | ||
$container = parent::provideBusinessLayerDependencies($container); | ||
|
||
$this->addCacheManagerPlugins($container); | ||
$this->addStorageClient($container); | ||
|
||
return $container; | ||
} | ||
|
||
/** | ||
* @param \Spryker\Zed\Kernel\Container $container | ||
* | ||
* @return void | ||
*/ | ||
protected function addCacheManagerPlugins(Container $container): void | ||
{ | ||
$container->set(self::CACHE_MANAGER_PLUGINS, function () { | ||
return $this->getCacheManagerPlugins(); | ||
}); | ||
} | ||
|
||
/** | ||
* @return array<\ValanticSpryker\Zed\CacheManager\Communication\Plugin\CacheManagerPluginInterface> | ||
*/ | ||
protected function getCacheManagerPlugins(): array | ||
{ | ||
return []; | ||
} | ||
|
||
/** | ||
* @param \Spryker\Zed\Kernel\Container $container | ||
* | ||
* @return void | ||
*/ | ||
protected function addStorageClient(Container $container): void | ||
{ | ||
$container->set( | ||
self::CLIENT_STORAGE, | ||
fn (): StorageClientInterface => $container->getLocator()->storage()->client() | ||
); | ||
} | ||
} |
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
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