Skip to content

Commit fc89609

Browse files
committed
TASK: Do not persist proxy class names but the parent
1 parent 616e984 commit fc89609

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Classes/Eel/ValueObjectHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ public function combineCollection(ImageSourceProxyCollection|ImageSourceProxy|nu
5454

5555
/**
5656
* @param ImageSourceProxyCollection|ImageSourceProxy|null ...$items
57-
* @return @return ImageSourceInterface[]
57+
* @return ImageSourceInterface[]
5858
*/
5959
public function combineAndUnwrapCollection(ImageSourceProxyCollection|ImageSourceProxy|null ...$items): array
6060
{
61-
return $this->unwrapProxyCollection( $this->combineCollection(...$items));
61+
return $this->unwrapProxyCollection($this->combineCollection(...$items));
6262
}
6363

6464
public function allowsCallOfMethod($methodName)

Classes/ImageAssetProxy.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Sitegeist\Kaleidoscope\ValueObjects;
66

7+
use Doctrine\Persistence\Proxy;
78
use Neos\Flow\Annotations as Flow;
89
use Neos\Media\Domain\Model\AssetInterface;
910
use Neos\Media\Domain\Model\Image;
@@ -42,9 +43,16 @@ public static function fromArray(array $data): self
4243

4344
public static function fromAsset(Image|ImageVariant $asset): self
4445
{
46+
if ($asset instanceof Proxy) {
47+
/** @var class-string $className */
48+
$className = get_parent_class($asset);
49+
} else {
50+
/** @var class-string $className */
51+
$className = get_class($asset);
52+
}
4553
return new self(
4654
$asset->getIdentifier(),
47-
get_class($asset),
55+
$className
4856
);
4957
}
5058

0 commit comments

Comments
 (0)