Skip to content

Commit cbb6a9a

Browse files
committed
Add the root item to the event
1 parent 6a88138 commit cbb6a9a

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/Event/GenerateBatchItemEvent.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,19 @@ final class GenerateBatchItemEvent
2222
/** @var object|array */
2323
private $item;
2424

25+
private ?object $rootItem;
26+
2527
/**
2628
* @param object|array $item
2729
*/
28-
public function __construct(FeedInterface $feed, FeedTypeInterface $feedType, ChannelInterface $channel, LocaleInterface $locale, $item)
30+
public function __construct(FeedInterface $feed, FeedTypeInterface $feedType, ChannelInterface $channel, LocaleInterface $locale, $item, object $rootItem = null)
2931
{
3032
$this->feed = $feed;
3133
$this->feedType = $feedType;
3234
$this->channel = $channel;
3335
$this->locale = $locale;
3436
$this->item = $item;
37+
$this->rootItem = $rootItem;
3538
}
3639

3740
public function getFeed(): FeedInterface
@@ -61,4 +64,9 @@ public function getItem()
6164
{
6265
return $this->item;
6366
}
67+
68+
public function getRootItem(): ?object
69+
{
70+
return $this->rootItem;
71+
}
6472
}

src/Message/Handler/GenerateBatchHandler.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ public function __invoke(GenerateBatch $message): void
171171
$channel,
172172
$locale,
173173
$context,
174+
$item,
174175
));
175176

176177
$constraintViolationList = $this->validator->validate(

0 commit comments

Comments
 (0)