Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);

/**
* Pimcore
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - Pimcore Commercial License (PCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace Pimcore\Bundle\StaticResolverBundle\Models\DataObject\ClassificationStore;

use Pimcore\Model\DataObject\Classificationstore\GroupConfig;
use Pimcore\Model\DataObject\Classificationstore\KeyConfig;

interface DefinitionCacheResolverInterface
{
public function get(
int $id,
string $type = 'key'
): ?KeyConfig;

public function put(GroupConfig|KeyConfig $config): void;

public function clear(GroupConfig|KeyConfig|null $config): void;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
declare(strict_types=1);

/**
* Pimcore
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - Pimcore Commercial License (PCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace Pimcore\Bundle\StaticResolverBundle\Models\DataObject\ClassificationStore;

use Pimcore\Model\DataObject\Classificationstore\DefinitionCache;
use Pimcore\Model\DataObject\Classificationstore\GroupConfig;
use Pimcore\Model\DataObject\Classificationstore\KeyConfig;

/**
* @internal
*/
final class DefinitionCacheResolverResolver implements DefinitionCacheResolverInterface
{
public function get(
int $id,
string $type = 'key'
): ?KeyConfig {
return DefinitionCache::get($id, $type);
}

public function put(GroupConfig|KeyConfig $config): void
{
DefinitionCache::put($config);
}

public function clear(GroupConfig|KeyConfig|null $config): void
{
DefinitionCache::clear($config);
}
}
44 changes: 44 additions & 0 deletions src/Models/DataObject/ClassificationStore/GroupConfigResolver.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
declare(strict_types=1);

/**
* Pimcore
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - Pimcore Commercial License (PCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace Pimcore\Bundle\StaticResolverBundle\Models\DataObject\ClassificationStore;

use Exception;
use Pimcore\Model\DataObject\Classificationstore\GroupConfig;

/**
* @internal
*/
final class GroupConfigResolver implements GroupConfigResolverInterface
{
public function getById(int $id, ?bool $force = false): ?GroupConfig
{
return GroupConfig::getById($id, $force);
}

/**
* @throws Exception
*/
public function getByName(string $name, int $storeId = 1, ?bool $force = false): ?GroupConfig
{
return GroupConfig::getByName($name, $storeId, $force);
}

public function create(): GroupConfig
{
return GroupConfig::create();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);

/**
* Pimcore
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - Pimcore Commercial License (PCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace Pimcore\Bundle\StaticResolverBundle\Models\DataObject\ClassificationStore;

use Exception;
use Pimcore\Model\DataObject\Classificationstore\GroupConfig;

interface GroupConfigResolverInterface
{
public function getById(int $id, ?bool $force = false): ?GroupConfig;

/**
* @throws Exception
*/
public function getByName(string $name, int $storeId = 1, ?bool $force = false): ?GroupConfig;

public function create(): GroupConfig;
}
Loading