request = $request; $this->actionFactory = $actionFactory; $this->metadataFactory = $metadataFactory; } public function beforeSave(Value $subject): Value { $metadata = $this->metadataFactory->create([ 'request' => $this->request, 'eventName' => MetadataInterface::EVENT_SAVE_BEFORE, 'loggingObject' => $subject ]); $actionHandler = $this->actionFactory->create($metadata); $actionHandler->execute(); return $subject; } }