Files
Chamilo/plugin/xapi/src/Hook/XApiPortfolioCommentEditedHookObserver.php
2025-08-14 22:39:38 +02:00

20 lines
647 B
PHP

<?php
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\PortfolioComment;
use Chamilo\PluginBundle\XApi\ToolExperience\Statement\PortfolioCommentEdited;
class XApiPortfolioCommentEditedHookObserver extends XApiActivityHookObserver implements HookPortfolioCommentEditedObserverInterface
{
public function hookCommentEdited(HookPortfolioCommentEditedEventInterface $hookEvent)
{
/** @var PortfolioComment $comment */
$comment = $hookEvent->getEventData()['comment'];
$statement = (new PortfolioCommentEdited($comment))->generate();
$this->saveSharedStatement($statement);
}
}