Skip to content

Commit 7e422fe

Browse files
committed
TASK: Add handling of internal properties and object properties
1 parent 1eda959 commit 7e422fe

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

Classes/Command/NodetypeObjectsCommandController.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
namespace PackageFactory\NodeTypeObjects\Command;
55

6-
use Behat\Gherkin\Node\NodeInterface;
76
use Neos\ContentRepository\Domain\Model\NodeType;
87
use Neos\ContentRepository\Domain\Service\NodeTypeManager;
98
use Neos\Flow\Cli\CommandController;
@@ -84,7 +83,11 @@ private function buildOne(FlowPackageInterface $package, NodeType $nodeType, str
8483

8584
$propertyAccesssors = '';
8685
foreach ($nodeType->getProperties() as $propertyName => $propertyConfig) {
87-
$methodName = 'get' . UnicodeFunctions::ucfirst($propertyName);
86+
if (str_starts_with($propertyName, '_')) {
87+
$methodName = 'getInternal' . UnicodeFunctions::ucfirst(substr($propertyName, 1));
88+
} else {
89+
$methodName = 'get' . UnicodeFunctions::ucfirst($propertyName);
90+
}
8891
$type = $propertyConfig[ 'type' ];
8992

9093
$annotationType = $type;
@@ -103,6 +106,9 @@ private function buildOne(FlowPackageInterface $package, NodeType $nodeType, str
103106
} elseif ($type === 'DateTime') {
104107
$phpType = '\DateTime';
105108
$annotationType = '\DateTime';
109+
} elseif (str_contains($type, '\\') && !str_starts_with($type, '\\')) {
110+
$annotationType = '\\' . $type;
111+
$phpType = '\\' . $type;
106112
}
107113

108114
$propertyAccesssors .= <<<EOL

0 commit comments

Comments
 (0)