CodeExplorer isModifiedRecently example
return $token;
} public function createFileResponse(Context
$context, string
$fileId, string
$accessToken): Response
{ $entity =
$this->
findFile($context,
$fileId);
$fileAccessToken =
(string) $entity->
getAccessToken();
if ($fileAccessToken === '' ||
$entity->
getAccessToken() !==
$accessToken || !
$this->
isModifiedRecently($entity)) { throw ImportExportException::
invalidFileAccessToken();
} $this->fileRepository->
update( [['id' =>
$fileId, 'accessToken' => null
]],
$context );
$originalName =
(string) preg_replace('/[\/\\\]/', '',
$entity->
getOriginalName());
$headers =
[