Skip to content

Commit e88ce2a

Browse files
author
roadiz-ci
committed
Merge branch release/v2.4.3
1 parent afd44c8 commit e88ce2a

File tree

4 files changed

+68
-1
lines changed

4 files changed

+68
-1
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
"require-dev": {
101101
"php-coveralls/php-coveralls": "^2.4",
102102
"phpstan/phpstan": "^1.5.3",
103+
"phpstan/phpdoc-parser": "<2",
103104
"phpstan/phpstan-doctrine": "^1.3",
104105
"phpunit/phpunit": "^9.5",
105106
"symfony/browser-kit": "6.4.*",

config/services.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
parameters:
3-
roadiz_core.cms_version: '2.4.2'
3+
roadiz_core.cms_version: '2.4.3'
44
roadiz_core.cms_version_prefix: 'main'
55
env(APP_NAMESPACE): "roadiz"
66
env(APP_VERSION): "0.1.0"
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace RZ\Roadiz\Migrations;
6+
7+
use Doctrine\DBAL\Schema\Schema;
8+
use Doctrine\Migrations\AbstractMigration;
9+
10+
/**
11+
* Auto-generated Migration: Please modify to your needs!
12+
*/
13+
final class Version20241218095458 extends AbstractMigration
14+
{
15+
public function getDescription(): string
16+
{
17+
return 'Added normalization_context to NodeTypeField';
18+
}
19+
20+
public function up(Schema $schema): void
21+
{
22+
$this->addSql('ALTER TABLE node_type_fields ADD normalization_context JSON DEFAULT NULL');
23+
}
24+
25+
public function down(Schema $schema): void
26+
{
27+
$this->addSql('ALTER TABLE node_type_fields DROP normalization_context');
28+
}
29+
}

src/Entity/NodeTypeField.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@ class NodeTypeField extends AbstractField implements NodeTypeFieldInterface, Ser
9898
]
9999
private ?array $serializationGroups = null;
100100

101+
#[
102+
Serializer\Groups(['node_type']),
103+
SymfonySerializer\Groups(['node_type']),
104+
Serializer\Type('array<string, array>'),
105+
ORM\Column(name: 'normalization_context', type: 'json', nullable: true)
106+
]
107+
private ?array $normalizationContext = null;
108+
101109
#[
102110
Serializer\Groups(['node_type']),
103111
SymfonySerializer\Groups(['node_type']),
@@ -330,4 +338,33 @@ public function setExcludedFromSerialization(bool $excludedFromSerialization): N
330338

331339
return $this;
332340
}
341+
342+
public function getNormalizationContext(): ?array
343+
{
344+
return $this->normalizationContext;
345+
}
346+
347+
public function setNormalizationContext(?array $normalizationContext): NodeTypeField
348+
{
349+
$this->normalizationContext = $normalizationContext;
350+
351+
return $this;
352+
}
353+
354+
#[SymfonySerializer\Ignore]
355+
public function getNormalizationContextGroups(): ?array
356+
{
357+
return $this->normalizationContext['groups'] ?? [];
358+
}
359+
360+
#[SymfonySerializer\Ignore]
361+
public function setNormalizationContextGroups(?array $normalizationContextGroups): NodeTypeField
362+
{
363+
if (null === $normalizationContextGroups) {
364+
$this->normalizationContext = null;
365+
}
366+
$this->normalizationContext['groups'] = $normalizationContextGroups;
367+
368+
return $this;
369+
}
333370
}

0 commit comments

Comments
 (0)