-
Notifications
You must be signed in to change notification settings - Fork 0
Integrate revisions with event dispatcher #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
JoelAlphonso
merged 14 commits into
joel_feat_event-dispatcher
from
Joel_feat_revision-event
Sep 30, 2022
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
117dad5
feat(object): add an ObjectServiceProvider for object package services
JoelAlphonso b41c7c2
refactor(revision): refactor revision object and interface to use Mod…
JoelAlphonso 8fb6b25
feat(revision): remove revision generation from Content.php
JoelAlphonso 0936d20
feat(revision): add a revision service to handle all revision related…
JoelAlphonso 4cb6fbb
feat(revision): add a listener to hook revision generation
JoelAlphonso 2bc3ece
feat(revision): add RevisionConfig.php to cast revisions config nodes to
JoelAlphonso f2cf7c9
feat(revision): add `properties` and `propertyBlacklist` options for …
JoelAlphonso fced96e
refactor(revision): refactor revision config and service to allow for…
JoelAlphonso feddd68
fix(revision): fix included properties and properties options
JoelAlphonso aef32f0
feat(revision): use the revisions service everywhere and refactor it …
JoelAlphonso 87490fa
refactor(revisions): rename `RevisionService` to `RevisionsManager`
JoelAlphonso a5640ce
refactor(revisions): rename revisions config and container keys with …
JoelAlphonso f296dab
refactor(revisions): rename `ObjectServiceProvider` to `RevisionServi…
JoelAlphonso 7d53094
refactor(revisions): fix method comments
JoelAlphonso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
30 changes: 30 additions & 0 deletions
30
packages/object/src/Charcoal/Object/GenerateRevisionListener.php
This file contains hidden or 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,30 @@ | ||
| <?php | ||
|
|
||
| namespace Charcoal\Object; | ||
|
|
||
| use Charcoal\Event\AbstractEventListener; | ||
| use Charcoal\Model\ModelInterface; | ||
| use Pimple\Container; | ||
|
|
||
| /** | ||
| * Listener | ||
| */ | ||
| class GenerateRevisionListener extends AbstractEventListener | ||
| { | ||
| protected RevisionsManager $revisionService; | ||
|
|
||
| public function __invoke(object $event) | ||
| { | ||
| /** @var ModelInterface $model */ | ||
| $model = $event->getObject(); | ||
|
|
||
| $this->revisionService->setModel($model)->generateRevision(); | ||
| } | ||
|
|
||
| public function setDependencies(Container $container) | ||
| { | ||
| parent::setDependencies($container); | ||
|
|
||
| $this->revisionService = $container->get('revisions/manager'); | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.