27 lines
861 B
PHP
27 lines
861 B
PHP
<?php
|
|
|
|
namespace Modules\Core\Review\Events;
|
|
|
|
use Modules\Core\Auth\Models\Staff;
|
|
use Modules\Core\Review\Models\ProductReview;
|
|
|
|
/**
|
|
* Dispatched whenever staff post or edit a reply to a review (see
|
|
* Modules\Core\Review\Services\ReviewService::reply()) — previously this
|
|
* happened with no event at all, so nothing could react to it (no audit
|
|
* trail, no "notify the reviewer their review got a reply" hook).
|
|
*
|
|
* $wasReply distinguishes a brand-new reply from an edit to an existing
|
|
* one — a listener building an audit trail or notification may care which
|
|
* happened (e.g. only notify the reviewer the first time, not on every
|
|
* subsequent edit).
|
|
*/
|
|
class ReviewReplied
|
|
{
|
|
public function __construct(
|
|
public readonly ProductReview $review,
|
|
public readonly Staff $repliedBy,
|
|
public readonly bool $wasReply,
|
|
) {}
|
|
}
|