1313{
1414 public function __construct (
1515 public NodeInterfaceNameSpecification $ interfaceName ,
16- public NodeInterfaceNameSpecificationCollection $ interfaceNames ,
1716 public NodePropertySpecificationCollection $ properties ,
18- public string $ directory ,
19- public string $ interfaceFilename ,
2017 ) {
2118 }
2219
23- public static function createFromPackageAndNodeType (
24- FlowPackageInterface $ package ,
20+ public static function createFromNodeType (
2521 NodeType $ nodeType ,
2622 ): self {
27-
28- if (!str_starts_with ($ nodeType ->name ->value , $ package ->getPackageKey () . ': ' )) {
29- throw new \Exception ("Only nodetypes from the given package are allowed " );
30- }
31-
32- $ nameSpecification = NodeInterfaceNameSpecification::createFromNodeType ($ nodeType );
33-
34- $ localNameParts = explode ('. ' , str_replace ($ package ->getPackageKey () . ': ' , '' , $ nodeType ->name ->value ));
35- $ localName = array_pop ($ localNameParts );
36- $ localNamespace = implode ('. ' , $ localNameParts );
37-
38- $ directory = $ package ->getPackagePath ()
39- . 'NodeTypes ' . DIRECTORY_SEPARATOR
40- . ($ localNamespace ? str_replace ('. ' , DIRECTORY_SEPARATOR , $ localNamespace ) . DIRECTORY_SEPARATOR : '' )
41- . $ localName ;
42-
43- $ interfaceFileName = $ directory . DIRECTORY_SEPARATOR . $ nameSpecification ->interfaceName . '.php ' ;
44-
4523 return new self (
46- $ nameSpecification ,
47- NodeInterfaceNameSpecificationCollection::createFromNodeType ($ nodeType ),
24+ NodeInterfaceNameSpecification::createFromNodeType ($ nodeType ),
4825 NodePropertySpecificationCollection::createFromNodeType ($ nodeType ),
49- $ directory ,
50- $ interfaceFileName
5126 );
5227 }
5328
@@ -71,15 +46,15 @@ public function toPhpString(): ?string
7146
7247 declare(strict_types=1);
7348
74- namespace {$ this ->interfaceName ->phpNamespace };
49+ namespace {$ this ->interfaceName ->getFullNamespace () };
7550
7651 use Neos\ContentRepository\Domain\Model\NodeInterface;
7752 use Neos\Flow\Annotations as Flow;
7853
7954 /**
8055 * AUTOGENERATED CODE ... DO NOT MODIFY !!!
8156 *
82- * run `./flow nodetypeobjects :build` to regenerate this
57+ * run `./flow nodebjects :build` to regenerate this
8358 */
8459 interface {$ this ->interfaceName ->interfaceName }
8560 {
0 commit comments