Skip to content

Commit 7e98d23

Browse files
authored
Add Role and Folder Resolver (#53)
* Add Role and Folder getById and create. * Apply php-cs-fixer changes --------- Co-authored-by: martineiber <martineiber@users.noreply.github.com>
1 parent f221300 commit 7e98d23

File tree

4 files changed

+125
-0
lines changed

4 files changed

+125
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
/**
5+
* Pimcore
6+
*
7+
* This source file is available under two different licenses:
8+
* - GNU General Public License version 3 (GPLv3)
9+
* - Pimcore Commercial License (PCL)
10+
* Full copyright and license information is available in
11+
* LICENSE.md which is distributed with this source code.
12+
*
13+
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
14+
* @license http://www.pimcore.org/license GPLv3 and PCL
15+
*/
16+
17+
namespace Pimcore\Bundle\StaticResolverBundle\Models\User\Role;
18+
19+
use Pimcore\Model\User\Role\Folder;
20+
21+
/**
22+
* @internal
23+
*/
24+
final class FolderResolver implements FolderResolverInterface
25+
{
26+
public function getById(int $id): ?Folder
27+
{
28+
return Folder::getById($id);
29+
}
30+
31+
public function create(array $values = []): Folder
32+
{
33+
return Folder::create($values);
34+
}
35+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
/**
5+
* Pimcore
6+
*
7+
* This source file is available under two different licenses:
8+
* - GNU General Public License version 3 (GPLv3)
9+
* - Pimcore Commercial License (PCL)
10+
* Full copyright and license information is available in
11+
* LICENSE.md which is distributed with this source code.
12+
*
13+
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
14+
* @license http://www.pimcore.org/license GPLv3 and PCL
15+
*/
16+
17+
namespace Pimcore\Bundle\StaticResolverBundle\Models\User\Role;
18+
19+
use Pimcore\Model\User\Role\Folder;
20+
21+
/**
22+
* @internal
23+
*/
24+
interface FolderResolverInterface
25+
{
26+
public function getById(int $id): ?Folder;
27+
28+
public function create(array $values = []): Folder;
29+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
/**
5+
* Pimcore
6+
*
7+
* This source file is available under two different licenses:
8+
* - GNU General Public License version 3 (GPLv3)
9+
* - Pimcore Commercial License (PCL)
10+
* Full copyright and license information is available in
11+
* LICENSE.md which is distributed with this source code.
12+
*
13+
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
14+
* @license http://www.pimcore.org/license GPLv3 and PCL
15+
*/
16+
17+
namespace Pimcore\Bundle\StaticResolverBundle\Models\User\Role;
18+
19+
use Pimcore\Model\User\Role;
20+
21+
/**
22+
* @internal
23+
*/
24+
final class RoleResolver implements RoleResolverInterface
25+
{
26+
public function getById(int $id): ?Role
27+
{
28+
return Role::getById($id);
29+
}
30+
31+
public function create(array $values = []): Role
32+
{
33+
return Role::create($values);
34+
}
35+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
/**
5+
* Pimcore
6+
*
7+
* This source file is available under two different licenses:
8+
* - GNU General Public License version 3 (GPLv3)
9+
* - Pimcore Commercial License (PCL)
10+
* Full copyright and license information is available in
11+
* LICENSE.md which is distributed with this source code.
12+
*
13+
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
14+
* @license http://www.pimcore.org/license GPLv3 and PCL
15+
*/
16+
17+
namespace Pimcore\Bundle\StaticResolverBundle\Models\User\Role;
18+
19+
use Pimcore\Model\User\Role;
20+
21+
interface RoleResolverInterface
22+
{
23+
public function getById(int $id): ?Role;
24+
25+
public function create(array $values = []): Role;
26+
}

0 commit comments

Comments
 (0)