Skip to content

Commit 4d72367

Browse files
committed
Jet Studio + Jet Core
------------------------- Property hooks - PHP 8.4 - support
1 parent 1184e60 commit 4d72367

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

library/Jet/Form/Definition.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,6 @@ public function getDefaultValueGetterName( bool $get_defined=false ): string
211211
return $this->default_value_getter_name;
212212
}
213213

214-
if($this->context_object instanceof BaseObject) {
215-
$getter_method_name = $this->context_object->objectGetterMethodName( $this->getPropertyName() );
216-
if(method_exists($this->context_object, $getter_method_name)) {
217-
return $getter_method_name;
218-
}
219-
}
220-
221214
return '';
222215

223216
}
@@ -260,9 +253,14 @@ public function setSetterName( string $setter_name ): void
260253
*/
261254
protected function getDefaultValue() : mixed
262255
{
256+
if(($default_value_getter = $this->getDefaultValueGetterName())) {
257+
return $this->context_object->{$default_value_getter}();
258+
}
259+
263260
$ref = new ReflectionClass($this->context_object);
264261
$property = $ref->getProperty($this->getPropertyName());
265262
return $property->getRawValue( $this->context_object );
263+
266264
}
267265

268266
/**

0 commit comments

Comments
 (0)