forked from silverstripe/silverstripe-versioned
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
97d1ac6
commit d2efe5a
Showing
12 changed files
with
267 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace SilverStripe\Versioned; | ||
|
||
use Psr\Container\NotFoundExceptionInterface; | ||
use SilverStripe\Core\Extension; | ||
use SilverStripe\ORM\DataObject; | ||
|
||
class RecursiveStagesExtension extends Extension | ||
{ | ||
/** | ||
* Make sure to flush cached data in case the data changes | ||
* Extension point in @see DataObject::onAfterWrite() | ||
* | ||
* @return void | ||
* @throws NotFoundExceptionInterface | ||
*/ | ||
public function onAfterWrite(): void | ||
{ | ||
RecursiveStagesService::reset(); | ||
} | ||
|
||
/** | ||
* Make sure to flush cached data in case the data changes | ||
* Extension point in @see DataObject::onAfterDelete() | ||
* | ||
* @return void | ||
* @throws NotFoundExceptionInterface | ||
*/ | ||
public function onAfterDelete(): void | ||
{ | ||
RecursiveStagesService::reset(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.