Skip to content

Commit 6ddad9c

Browse files
authored
Add get element from session (#82)
* Add methods to interface and implementation * Apply php-cs-fixer changes
1 parent 7376ce5 commit 6ddad9c

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/Models/Element/ServiceResolver.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,13 @@ public function getSafeCopyName(string $sourceKey, ElementInterface $target): st
6262
{
6363
return Service::getSafeCopyName($sourceKey, $target);
6464
}
65+
66+
public function getElementFromSession(
67+
string $type,
68+
int $elementId,
69+
string $sessionId,
70+
?string $postfix = ''
71+
): null|Asset|AbstractObject|Document {
72+
return Service::getElementFromSession($type, $elementId, $sessionId, $postfix);
73+
}
6574
}

src/Models/Element/ServiceResolverInterface.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,11 @@ public function isPublished(ElementInterface $element = null): bool;
4848
public function getValidKey(string $key, string $type): string;
4949

5050
public function getSafeCopyName(string $sourceKey, ElementInterface $target): string;
51+
52+
public function getElementFromSession(
53+
string $type,
54+
int $elementId,
55+
string $sessionId,
56+
?string $postfix = ''
57+
): null|Asset|AbstractObject|Document;
5158
}

0 commit comments

Comments
 (0)