designtopack/public/site/config/hooks/file-update--regenerate-project-steps-cache.php

11 lines
398 B
PHP
Raw Permalink Normal View History

<?php
// file.update:after
return function ($newFile, $oldFile) {
$project = $newFile->parent()->template() == 'project' ? $newFile->parent() : $newFile->parent()->parents()->findBy('template', 'project');
if ($project) {
$project->rebuildStepsCache();
// Invalider aussi le cache des notifications (commentaires sur fichiers, etc.)
$project->invalidateNotificationsCache();
}
};