-
-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5371 from mhsdesign/bugfix/copy-nodes-as-a-service
FEATURE: Node copying Version 3 (as a Neos service)
- Loading branch information
Showing
26 changed files
with
1,331 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 0 additions & 90 deletions
90
...ository.BehavioralTests/Tests/Behavior/Features/NodeCopying/CopyNode_NoDimensions.feature
This file was deleted.
Oops, something went wrong.
62 changes: 62 additions & 0 deletions
62
Neos.ContentRepository.Core/Classes/CommandHandler/Commands.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Neos\ContentRepository\Core\CommandHandler; | ||
|
||
/** | ||
* @api can be used as collection of commands to be individually handled: | ||
* | ||
* foreach ($commands as $command) { | ||
* $contentRepository->handle($command); | ||
* } | ||
* | ||
* @implements \IteratorAggregate<CommandInterface> | ||
*/ | ||
final readonly class Commands implements \IteratorAggregate, \Countable | ||
{ | ||
/** @var array<int,CommandInterface> */ | ||
private array $items; | ||
|
||
private function __construct( | ||
CommandInterface ...$items | ||
) { | ||
$this->items = array_values($items); | ||
} | ||
|
||
public static function create(CommandInterface ...$items): self | ||
{ | ||
return new self(...$items); | ||
} | ||
|
||
public static function createEmpty(): self | ||
{ | ||
return new self(); | ||
} | ||
|
||
/** @param array<CommandInterface> $array */ | ||
public static function fromArray(array $array): self | ||
{ | ||
return new self(...$array); | ||
} | ||
|
||
public function append(CommandInterface $command): self | ||
{ | ||
return new self(...[...$this->items, $command]); | ||
} | ||
|
||
public function merge(self $other): self | ||
{ | ||
return new self(...$this->items, ...$other->items); | ||
} | ||
|
||
public function getIterator(): \Traversable | ||
{ | ||
yield from $this->items; | ||
} | ||
|
||
public function count(): int | ||
{ | ||
return count($this->items); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Subtrees.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Neos\ContentRepository\Core\Projection\ContentGraph; | ||
|
||
/** | ||
* @api part of {@see Subtree} | ||
* @implements \IteratorAggregate<Subtree> | ||
*/ | ||
final readonly class Subtrees implements \IteratorAggregate, \Countable | ||
{ | ||
/** @var array<Subtree> */ | ||
private array $items; | ||
|
||
private function __construct( | ||
Subtree ...$items | ||
) { | ||
$this->items = $items; | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
public static function createEmpty(): self | ||
{ | ||
return new self(); | ||
} | ||
|
||
/** | ||
* @internal | ||
* @param array<Subtree> $items | ||
*/ | ||
public static function fromArray(array $items): self | ||
{ | ||
return new self(...$items); | ||
} | ||
|
||
public function getIterator(): \Traversable | ||
{ | ||
yield from $this->items; | ||
} | ||
|
||
public function count(): int | ||
{ | ||
return count($this->items); | ||
} | ||
} |
Oops, something went wrong.