File tree 1 file changed +7
-2
lines changed
src/Domain/Model/Messaging
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ class TemplateImage implements DomainModel, Identity
26
26
private ?string $ filename = null ;
27
27
28
28
#[ORM \Column(name: 'data ' , type: 'blob ' , nullable: true )]
29
- private ? string $ data = null ;
29
+ private mixed $ data = null ;
30
30
31
31
#[ORM \Column(name: 'width ' , type: 'integer ' , nullable: true )]
32
32
private ?int $ width = null ;
@@ -51,6 +51,11 @@ public function getFilename(): ?string
51
51
52
52
public function getData (): ?string
53
53
{
54
+ if (is_resource ($ this ->data )) {
55
+ rewind ($ this ->data );
56
+ return stream_get_contents ($ this ->data );
57
+ }
58
+
54
59
return $ this ->data ;
55
60
}
56
61
@@ -84,7 +89,7 @@ public function setFilename(?string $filename): self
84
89
85
90
public function setData (?string $ data ): self
86
91
{
87
- $ this ->data = $ data ;
92
+ $ this ->data = $ data !== null ? fopen ( ' data://text/plain, ' . $ data , ' r ' ) : null ;
88
93
return $ this ;
89
94
}
90
95
You can’t perform that action at this time.
0 commit comments