Skip to content

Commit b4e0a60

Browse files
committed
Mark pages as not writable in the API for Layout
1 parent abb7a73 commit b4e0a60

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/Entity/Core/Layout.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
use ApiPlatform\Doctrine\Orm\Filter\OrderFilter;
1717
use ApiPlatform\Metadata\ApiFilter;
18+
use ApiPlatform\Metadata\ApiProperty;
1819
use ApiPlatform\Metadata\ApiResource;
1920
use Doctrine\Common\Collections\ArrayCollection;
2021
use Doctrine\Common\Collections\Collection;
@@ -47,7 +48,8 @@ class Layout
4748
/**
4849
* @var Collection<int, Page>
4950
*/
50-
private Collection $pages;
51+
#[ApiProperty(writable: false)]
52+
public Collection $pages;
5153

5254
public function __construct()
5355
{
@@ -61,9 +63,4 @@ public static function loadValidatorMetadata(ClassMetadata $metadata): void
6163
'message' => 'You must define the uiComponent for this resource.',
6264
]));
6365
}
64-
65-
public function getPages(): Collection
66-
{
67-
return $this->pages;
68-
}
6966
}

0 commit comments

Comments
 (0)