Skip to content

Commit

Permalink
Add FieldCollectionDefinitionResolver. (#29)
Browse files Browse the repository at this point in the history
* Add FieldCollectionDefinitionResolver.

* Make class internal and final.
  • Loading branch information
martineiber authored Feb 12, 2024
1 parent c2514e6 commit 06373f7
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/Models/DataObject/FieldCollection/DefinitionResolver.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?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\FieldCollection;

use Exception;
use Pimcore\Model\DataObject\Fieldcollection\Definition;

/**
* @internal
*/
final class DefinitionResolver implements DefinitionResolverInterface
{
/**
* @throws Exception
*/
public function getByKey(string $key): ?Definition
{
return Definition::getByKey($key);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?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\FieldCollection;

use Pimcore\Model\DataObject\Fieldcollection\Definition;

interface DefinitionResolverInterface
{
public function getByKey(string $key): ?Definition;
}

0 comments on commit 06373f7

Please sign in to comment.