Skip to content

Commit 807197c

Browse files
authored
[Website Settings]: Add resolver (#111)
* Add website settings resolver * Apply php-cs-fixer changes
1 parent 99032b4 commit 807197c

File tree

4 files changed

+112
-0
lines changed

4 files changed

+112
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
/**
5+
* This source file is available under the terms of the
6+
* Pimcore Open Core License (POCL)
7+
* Full copyright and license information is available in
8+
* LICENSE.md which is distributed with this source code.
9+
*
10+
* @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com)
11+
* @license Pimcore Open Core License (POCL)
12+
*/
13+
14+
namespace Pimcore\Bundle\StaticResolverBundle\Contract\Models\WebsiteSetting;
15+
16+
use Exception;
17+
use Pimcore\Model\WebsiteSetting;
18+
19+
class WebsiteSettingResolverContract implements WebsiteSettingResolverContractInterface
20+
{
21+
public function getById(int $id): ?WebsiteSetting
22+
{
23+
return WebsiteSetting::getById($id);
24+
}
25+
26+
/**
27+
* @throws Exception
28+
*/
29+
public function getByName(
30+
string $name,
31+
?int $siteId = null,
32+
?string $language = null,
33+
?string $fallbackLanguage = null
34+
): ?WebsiteSetting {
35+
return WebsiteSetting::getByName($name, $siteId, $language, $fallbackLanguage);
36+
}
37+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
/**
5+
* This source file is available under the terms of the
6+
* Pimcore Open Core License (POCL)
7+
* Full copyright and license information is available in
8+
* LICENSE.md which is distributed with this source code.
9+
*
10+
* @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com)
11+
* @license Pimcore Open Core License (POCL)
12+
*/
13+
14+
namespace Pimcore\Bundle\StaticResolverBundle\Contract\Models\WebsiteSetting;
15+
16+
use Exception;
17+
use Pimcore\Model\WebsiteSetting;
18+
19+
interface WebsiteSettingResolverContractInterface
20+
{
21+
public function getById(int $id): ?WebsiteSetting;
22+
23+
/**
24+
* @throws Exception
25+
*/
26+
public function getByName(
27+
string $name,
28+
?int $siteId = null,
29+
?string $language = null,
30+
?string $fallbackLanguage = null
31+
): ?WebsiteSetting;
32+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
/**
5+
* This source file is available under the terms of the
6+
* Pimcore Open Core License (POCL)
7+
* Full copyright and license information is available in
8+
* LICENSE.md which is distributed with this source code.
9+
*
10+
* @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com)
11+
* @license Pimcore Open Core License (POCL)
12+
*/
13+
14+
namespace Pimcore\Bundle\StaticResolverBundle\Models\WebsiteSetting;
15+
16+
use Pimcore\Bundle\StaticResolverBundle\Contract\Models\WebsiteSetting\WebsiteSettingResolverContract;
17+
18+
class WebsiteSettingResolver extends WebsiteSettingResolverContract implements WebsiteSettingResolverInterface
19+
{
20+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
/**
5+
* This source file is available under the terms of the
6+
* Pimcore Open Core License (POCL)
7+
* Full copyright and license information is available in
8+
* LICENSE.md which is distributed with this source code.
9+
*
10+
* @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com)
11+
* @license Pimcore Open Core License (POCL)
12+
*/
13+
14+
namespace Pimcore\Bundle\StaticResolverBundle\Models\WebsiteSetting;
15+
16+
use Pimcore\Bundle\StaticResolverBundle\Contract\Models\WebsiteSetting\WebsiteSettingResolverContractInterface;
17+
18+
/**
19+
* @internal
20+
*/
21+
interface WebsiteSettingResolverInterface extends WebsiteSettingResolverContractInterface
22+
{
23+
}

0 commit comments

Comments
 (0)