- Some minor on request debugger
This commit is contained in:
1 parent
c3e3d6a73a
commit
ba74c5a38e
17 files changed
+255
-202
No files matched your search
@@ -36,6 +36,13 @@ class EntityDescriptor
|
||||
if ($field) {
|
||||
$types = $property->getTypes();
|
||||
|
||||
if ($property->value ?? false) {
|
||||
$default = $property->value instanceof \BackedEnum ? $property->value->value : $property->value;
|
||||
}
|
||||
else {
|
||||
$default = $field->object->attributes['default'] ?? null;
|
||||
}
|
||||
|
||||
$fields[] = [
|
||||
'name' => $property->name,
|
||||
'description' => $entityField->object->description ?? "",
|
||||
@@ -45,6 +52,7 @@ class EntityDescriptor
|
||||
'allowNulls' => $property->allowsNull(),
|
||||
'length' => $field->object->length ?? null,
|
||||
'readonly' => $field->object->readonly,
|
||||
'default' => $default,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -57,8 +65,15 @@ class EntityDescriptor
|
||||
$field = $property->getAttribute(SearchParameter::class);
|
||||
|
||||
if ($field) {
|
||||
$possibleValues = null;
|
||||
$types = $property->getTypes();
|
||||
|
||||
foreach($types as $type) {
|
||||
if (! $type->builtIn && enum_exists($type->type)) {
|
||||
$possibleValues = implode(', ', array_map(fn($e) => $e->value, $type->type::cases()));
|
||||
}
|
||||
}
|
||||
|
||||
$searchFields[] = [
|
||||
'name' => $property->name,
|
||||
'description' => $field->object->description,
|
||||
@@ -66,6 +81,7 @@ class EntityDescriptor
|
||||
'tag' => $field->tag,
|
||||
'type' => implode(' | ', array_map(fn($e) => $e->type, $types)),
|
||||
'allowNulls' => $property->allowsNull(),
|
||||
'possibleValues' => $possibleValues,
|
||||
'default' => $this->displayValue($property->value ?? "")
|
||||
];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user