private function getEntitySchema(EntityDefinition
$definition): array
{ $fields =
$definition->
getFields();
$properties =
[];
foreach ($fields as $field) { $properties[$field->
getPropertyName()] =
$this->
parseField($definition,
$field);
} $result =
[ 'entity' =>
$definition->
getEntityName(),
'properties' =>
$properties,
'write-protected' =>
$definition->
getProtections()->
get(WriteProtection::
class) !== null,
'read-protected' =>
$definition->
getProtections()->
get(ReadProtection::
class) !== null,
];
if ($definition instanceof DynamicEntityDefinition
) { $result['flags'
] =
$definition->
getFlags();
}