[TOOLS] Fix the generate_entities_fields script
This commit is contained in:
parent
42321b936f
commit
c583c0f266
@ -12,7 +12,7 @@ const types = [
|
|||||||
'blob' => '',
|
'blob' => '',
|
||||||
'bool' => 'bool',
|
'bool' => 'bool',
|
||||||
'char' => 'string',
|
'char' => 'string',
|
||||||
'datetime' => 'DateTime',
|
'datetime' => '\DateTimeInterface',
|
||||||
'html' => 'string',
|
'html' => 'string',
|
||||||
'int' => 'int',
|
'int' => 'int',
|
||||||
'numeric' => 'float',
|
'numeric' => 'float',
|
||||||
@ -28,9 +28,10 @@ $files = glob($path . '/*.php');
|
|||||||
|
|
||||||
foreach ($files as $file) {
|
foreach ($files as $file) {
|
||||||
require_once $file;
|
require_once $file;
|
||||||
$declared = get_declared_classes();
|
|
||||||
|
|
||||||
$class = end($declared);
|
$declared = get_declared_classes();
|
||||||
|
$class = end($declared);
|
||||||
|
|
||||||
$no_ns_class = preg_replace('/.*?\\\\/', '', $class);
|
$no_ns_class = preg_replace('/.*?\\\\/', '', $class);
|
||||||
$schema = $class::schemaDef();
|
$schema = $class::schemaDef();
|
||||||
$fields = array_keys($schema['fields']);
|
$fields = array_keys($schema['fields']);
|
||||||
|
Loading…
Reference in New Issue
Block a user