Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
2de03381
Unverified
Commit
2de03381
authored
Jul 11, 2017
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create an interface for all "changing entities" events
parent
0e903c71
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
2 deletions
+27
-2
EntityIsChanging.php
Modules/Core/Contracts/EntityIsChanging.php
+22
-0
UserIsCreating.php
Modules/User/Events/UserIsCreating.php
+3
-1
UserIsUpdating.php
Modules/User/Events/UserIsUpdating.php
+2
-1
No files found.
Modules/Core/Contracts/EntityIsChanging.php
0 → 100644
View file @
2de03381
<?php
namespace
Modules\Core\Contracts
;
interface
EntityIsChanging
{
/**
* Get the attributes used to create or modify an entity
* @return array
*/
public
function
getAttributes
();
/**
* Set the attributes used to create or modify an entity
* @param array $attributes
*/
public
function
setAttributes
(
array
$attributes
);
/**
* Get the original attributes untouched by other listeners
* @return array
*/
public
function
getOriginal
();
}
Modules/User/Events/UserIsCreating.php
View file @
2de03381
...
...
@@ -2,7 +2,9 @@
namespace
Modules\User\Events
;
final
class
UserIsCreating
use
Modules\Core\Contracts\EntityIsChanging
;
final
class
UserIsCreating
implements
EntityIsChanging
{
/**
* Contains the attributes which can be changed by other listeners
...
...
Modules/User/Events/UserIsUpdating.php
View file @
2de03381
...
...
@@ -2,9 +2,10 @@
namespace
Modules\User\Events
;
use
Modules\Core\Contracts\EntityIsChanging
;
use
Modules\User\Entities\UserInterface
;
class
UserIsUpdat
ing
final
class
UserIsUpdating
implements
EntityIsChang
ing
{
/**
* @var UserInterface
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment