@@ -10,27 +10,27 @@ |
||
10 | 10 | class FileService |
11 | 11 | { |
12 | 12 | |
13 | - public function __construct( |
|
13 | + public function __construct( |
|
14 | 14 | private EntityManagerInterface $manager, |
15 | 15 | private DomainService $domainService |
16 | 16 | |
17 | - ) {} |
|
17 | + ) {} |
|
18 | 18 | |
19 | 19 | |
20 | - public function getFileUrl(People $people): ?array |
|
21 | - { |
|
20 | + public function getFileUrl(People $people): ?array |
|
21 | + { |
|
22 | 22 | if ($people->getImage() instanceof File) |
23 | - return [ |
|
23 | + return [ |
|
24 | 24 | 'id' => $people->getImage()->getId(), |
25 | 25 | 'domain' => $this->domainService->getMainDomain(), |
26 | 26 | 'url' => '/files/' . $people->getImage()->getId() . '/download' |
27 | - ]; |
|
27 | + ]; |
|
28 | 28 | |
29 | 29 | return null; |
30 | - } |
|
30 | + } |
|
31 | 31 | |
32 | - public function addFile(People $people, string $content, string $context, string $fileName, string $fileType, string $extension): File |
|
33 | - { |
|
32 | + public function addFile(People $people, string $content, string $context, string $fileName, string $fileType, string $extension): File |
|
33 | + { |
|
34 | 34 | return $this->manager->getRepository(File::class)->addFile($people, $content, $context, $fileName, $fileType, $extension); |
35 | - } |
|
35 | + } |
|
36 | 36 | } |
@@ -19,12 +19,13 @@ |
||
19 | 19 | |
20 | 20 | public function getFileUrl(People $people): ?array |
21 | 21 | { |
22 | - if ($people->getImage() instanceof File) |
|
23 | - return [ |
|
22 | + if ($people->getImage() instanceof File) { |
|
23 | + return [ |
|
24 | 24 | 'id' => $people->getImage()->getId(), |
25 | 25 | 'domain' => $this->domainService->getMainDomain(), |
26 | 26 | 'url' => '/files/' . $people->getImage()->getId() . '/download' |
27 | 27 | ]; |
28 | + } |
|
28 | 29 | |
29 | 30 | return null; |
30 | 31 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | public function addLine($prefix = '', $suffix = '', $delimiter = ' ') |
25 | 25 | { |
26 | 26 | $initialSpace = str_repeat(" ", $this->initialSpace); |
27 | - $count = $this->totalChars - $this->initialSpace - strlen($prefix) - strlen($suffix); |
|
27 | + $count = $this->totalChars - $this->initialSpace - strlen($prefix) - strlen($suffix); |
|
28 | 28 | if ($count > 0) |
29 | 29 | $delimiter = str_repeat($delimiter, $count); |
30 | 30 | $this->text .= $initialSpace . $prefix . $delimiter . $suffix . "\n"; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | public function generatePrintData(Device $device): Spool |
34 | 34 | { |
35 | - $content = [ |
|
35 | + $content = [ |
|
36 | 36 | "operation" => "PRINT_TEXT", |
37 | 37 | "styles" => [[]], |
38 | 38 | "value" => [$this->text] |
@@ -70,31 +70,31 @@ |
||
70 | 70 | #[Entity(repositoryClass: FileRepository::class)] |
71 | 71 | class File |
72 | 72 | { |
73 | - #[Groups(['file:read', 'spool:read', 'category:read', 'product_category:read', 'order_product:read', 'product_file:read', 'product:read', 'spool_item:read', 'file_item:read', 'contract:read', 'model:read', 'people:read'])] |
|
73 | + #[Groups(['file:read', 'spool:read', 'category:read', 'product_category:read', 'order_product:read', 'product_file:read', 'product:read', 'spool_item:read', 'file_item:read', 'contract:read', 'model:read', 'people:read'])] |
|
74 | 74 | #[Column(type: 'integer', nullable: false)] |
75 | 75 | #[Id] |
76 | 76 | #[GeneratedValue(strategy: 'IDENTITY')] |
77 | 77 | private int $id; |
78 | 78 | |
79 | - #[Groups(['file:read', 'spool:read', 'category:read', 'product_category:read', 'order_product:read', 'product_file:read', 'product:read', 'spool_item:read', 'file_item:read', 'file:write', 'contract:read', 'model:read', 'people:read'])] |
|
79 | + #[Groups(['file:read', 'spool:read', 'category:read', 'product_category:read', 'order_product:read', 'product_file:read', 'product:read', 'spool_item:read', 'file_item:read', 'file:write', 'contract:read', 'model:read', 'people:read'])] |
|
80 | 80 | #[NotBlank] |
81 | 81 | #[ApiFilter(filterClass: SearchFilter::class, properties: ['fileType' => 'exact'])] |
82 | 82 | #[Column(type: 'string', length: 255, nullable: false)] |
83 | 83 | private string $fileType; |
84 | 84 | |
85 | - #[Groups(['file:read', 'spool:read', 'category:read', 'product_category:read', 'order_product:read', 'product_file:read', 'product:read', 'spool_item:read', 'file_item:read', 'file:write', 'contract:read', 'model:read', 'people:read'])] |
|
85 | + #[Groups(['file:read', 'spool:read', 'category:read', 'product_category:read', 'order_product:read', 'product_file:read', 'product:read', 'spool_item:read', 'file_item:read', 'file:write', 'contract:read', 'model:read', 'people:read'])] |
|
86 | 86 | #[NotBlank] |
87 | 87 | #[ApiFilter(filterClass: SearchFilter::class, properties: ['fileName' => 'exact'])] |
88 | 88 | #[Column(type: 'string', length: 255, nullable: false)] |
89 | 89 | private string $fileName; |
90 | 90 | |
91 | - #[Groups(['file:read', 'spool:read', 'category:read', 'product_category:read', 'order_product:read', 'product_file:read', 'product:read', 'spool_item:read', 'file_item:read', 'file:write', 'contract:read', 'model:read', 'people:read'])] |
|
91 | + #[Groups(['file:read', 'spool:read', 'category:read', 'product_category:read', 'order_product:read', 'product_file:read', 'product:read', 'spool_item:read', 'file_item:read', 'file:write', 'contract:read', 'model:read', 'people:read'])] |
|
92 | 92 | #[NotBlank] |
93 | 93 | #[ApiFilter(filterClass: SearchFilter::class, properties: ['context' => 'exact'])] |
94 | 94 | #[Column(type: 'string', length: 255, nullable: false)] |
95 | 95 | private string $context; |
96 | 96 | |
97 | - #[Groups(['file:read', 'spool:read', 'category:read', 'product_category:read', 'order_product:read', 'product_file:read', 'product:read', 'spool_item:read', 'file_item:read', 'file:write', 'contract:read', 'model:read', 'people:read'])] |
|
97 | + #[Groups(['file:read', 'spool:read', 'category:read', 'product_category:read', 'order_product:read', 'product_file:read', 'product:read', 'spool_item:read', 'file_item:read', 'file:write', 'contract:read', 'model:read', 'people:read'])] |
|
98 | 98 | #[NotBlank] |
99 | 99 | #[ApiFilter(filterClass: SearchFilter::class, properties: ['extension' => 'exact'])] |
100 | 100 | #[Column(type: 'string', length: 255, nullable: false)] |
@@ -39,7 +39,7 @@ |
||
39 | 39 | #[ORM\Column(name: 'id', type: 'integer', nullable: false)] |
40 | 40 | #[ORM\Id] |
41 | 41 | #[ORM\GeneratedValue(strategy: 'IDENTITY')] |
42 | - #[Groups(['spool_item:read', 'spool:read',])] |
|
42 | + #[Groups(['spool_item:read', 'spool:read', ])] |
|
43 | 43 | private $id; |
44 | 44 | |
45 | 45 |