Source of file Handler.php
Size: 0,833 Bytes - Last Modified: 2021-12-23T10:36:11+00:00
/var/www/docs.ssmods.com/process/src/src/Handler/GraphQL/Middleware/Handler.php
12345678910111213141516171819202122232425262728293031323334 | <?php namespace SilverStripe\Snapshots\Handler\GraphQL\Middleware; use SilverStripe\EventDispatcher\Event\EventContextInterface; use SilverStripe\ORM\ValidationException; use SilverStripe\Snapshots\Handler\HandlerAbstract; use SilverStripe\Snapshots\Snapshot; class Handler extends HandlerAbstract { /** * @param EventContextInterface $context * @return Snapshot|null * @throws ValidationException */ protected function createSnapshot(EventContextInterface $context): ?Snapshot { $action = $context->getAction(); if ($action === null) { return null; } $page = $this->getPageContextProvider()->getPageFromReferrer(); if ($page === null) { return null; } return Snapshot::singleton()->createSnapshot($page); } } |