[TOOLS] Fix the generate_entities_fields script

This commit is contained in:
Hugo Sales 2020-03-30 17:16:44 +00:00 committed by Hugo Sales
parent 42321b936f
commit c583c0f266
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
1 changed files with 4 additions and 3 deletions

View File

@ -12,7 +12,7 @@ const types = [
'blob' => '',
'bool' => 'bool',
'char' => 'string',
'datetime' => 'DateTime',
'datetime' => '\DateTimeInterface',
'html' => 'string',
'int' => 'int',
'numeric' => 'float',
@ -28,9 +28,10 @@ $files = glob($path . '/*.php');
foreach ($files as $file) {
require_once $file;
$declared = get_declared_classes();
$class = end($declared);
$declared = get_declared_classes();
$class = end($declared);
$no_ns_class = preg_replace('/.*?\\\\/', '', $class);
$schema = $class::schemaDef();
$fields = array_keys($schema['fields']);