44
55namespace PackageFactory \NodeTypeObjects \Command ;
66
7- use Neos \ContentRepository \Domain \ Model \ NodeType ;
8- use Neos \ContentRepository \ Domain \ Service \ NodeTypeManager ;
7+ use Neos \ContentRepository \Core \ SharedModel \ ContentRepository \ ContentRepositoryId ;
8+ use Neos \ContentRepositoryRegistry \ ContentRepositoryRegistry ;
99use Neos \Flow \Cli \CommandController ;
10- use Neos \Flow \Core \Bootstrap ;
1110use Neos \Flow \Package \FlowPackageInterface ;
1211use Neos \Flow \Package \PackageManager ;
1312use Neos \Utility \Files ;
14- use Neos \Utility \Unicode \Functions as UnicodeFunctions ;
1513use PackageFactory \NodeTypeObjects \Factory \NodeTypeObjectFileFactory ;
1614use PackageFactory \NodeTypeObjects \Factory \NodeTypeSpecificationFactory ;
1715
1816class NodetypeObjectsCommandController extends CommandController
1917{
20- private NodeTypeManager $ nodeTypeManager ;
2118 private PackageManager $ packageManager ;
2219 private NodeTypeSpecificationFactory $ nodeTypeSpecificationFactory ;
2320 private NodeTypeObjectFileFactory $ nodeTypeObjectFileFactory ;
21+ private ContentRepositoryRegistry $ contentRepositoryRegistry ;
2422
25-
26-
27- public function injectNodeTypeManager (NodeTypeManager $ nodeTypeManager ): void
23+ public function injectPackageManager (PackageManager $ packageManager ): void
2824 {
29- $ this ->nodeTypeManager = $ nodeTypeManager ;
25+ $ this ->packageManager = $ packageManager ;
3026 }
3127
32- public function injectPackageManager ( PackageManager $ packageManager ): void
28+ public function injectContentRepositoryRegistry ( ContentRepositoryRegistry $ contentRepositoryRegistry ): void
3329 {
34- $ this ->packageManager = $ packageManager ;
30+ $ this ->contentRepositoryRegistry = $ contentRepositoryRegistry ;
3531 }
3632
33+
3734 public function injectNodeTypeSpecificationFactory (NodeTypeSpecificationFactory $ nodeTypeSpecificationFactory ): void
3835 {
3936 $ this ->nodeTypeSpecificationFactory = $ nodeTypeSpecificationFactory ;
@@ -80,7 +77,7 @@ public function cleanCommand(string $packageKey): void
8077 *
8178 * @param string $packageKey PackageKey
8279 */
83- public function buildCommand (string $ packageKey ): void
80+ public function buildCommand (string $ packageKey, string $ crId = ' default ' ): void
8481 {
8582 if ($ this ->packageManager ->isPackageAvailable ($ packageKey )) {
8683 $ package = $ this ->packageManager ->getPackage ($ packageKey );
@@ -92,10 +89,11 @@ public function buildCommand(string $packageKey): void
9289 $ this ->output ->outputLine ($ packageKey . " is not a Flow package " );
9390 $ this ->quit (1 );
9491 }
95-
96- $ nodeTypes = $ this ->nodeTypeManager ->getNodeTypes (false );
92+ $ contentRepository = $ this ->contentRepositoryRegistry ->get (ContentRepositoryId::fromString ($ crId ));
93+ $ nodeTypeManager = $ contentRepository ->getNodeTypeManager ();
94+ $ nodeTypes = $ nodeTypeManager ->getNodeTypes (false );
9795 foreach ($ nodeTypes as $ nodeType ) {
98- if (!str_starts_with ($ nodeType ->getName () , $ packageKey . ': ' )) {
96+ if (!str_starts_with ($ nodeType ->name -> value , $ packageKey . ': ' )) {
9997 continue ;
10098 }
10199
0 commit comments