Skip to content

Commit 74ab5c3

Browse files
Internal: Fix ExtraFieldOptions locale setter
1 parent eb52692 commit 74ab5c3

1 file changed

Lines changed: 15 additions & 12 deletions

File tree

src/CoreBundle/Entity/ExtraFieldOptions.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,12 @@ class ExtraFieldOptions
4545
#[Gedmo\Locale]
4646
private ?string $locale = null;
4747

48-
/**
49-
* @return int
50-
*/
51-
public function getId()
48+
public function getId(): ?int
5249
{
5350
return $this->id;
5451
}
5552

56-
/**
57-
* @return int
58-
*/
59-
public function getOptionOrder()
53+
public function getOptionOrder(): ?int
6054
{
6155
return $this->optionOrder;
6256
}
@@ -80,10 +74,7 @@ public function setField(ExtraField $field): self
8074
return $this;
8175
}
8276

83-
/**
84-
* @return string
85-
*/
86-
public function getValue()
77+
public function getValue(): ?string
8778
{
8879
return $this->value;
8980
}
@@ -131,6 +122,18 @@ public function setPriorityMessage(string $priorityMessage): self
131122
return $this;
132123
}
133124

125+
/**
126+
* Backward-compatibility alias for legacy code calling setLocale().
127+
* Gedmo Translatable expects the locale to be injected through the "Locale" field.
128+
*/
129+
public function setLocale(string $locale): self
130+
{
131+
return $this->setTranslatableLocale($locale);
132+
}
133+
134+
/**
135+
* Sets the locale used by Gedmo Translatable for this entity.
136+
*/
134137
public function setTranslatableLocale(string $locale): self
135138
{
136139
$this->locale = $locale;

0 commit comments

Comments
 (0)