Making the original property private and adding getting to get it, making it immutable.

Adding description on attributes
parent 23e2e981
...@@ -5,10 +5,15 @@ namespace Modules\User\Events; ...@@ -5,10 +5,15 @@ namespace Modules\User\Events;
final class UserIsCreating final class UserIsCreating
{ {
/** /**
* Contains the attributes which can be changed by other listeners
* @var array * @var array
*/ */
private $attributes; private $attributes;
public $original; /**
* Contains the original attributes which cannot be changed
* @var array
*/
private $original;
public function __construct(array $attributes) public function __construct(array $attributes)
{ {
...@@ -31,4 +36,12 @@ final class UserIsCreating ...@@ -31,4 +36,12 @@ final class UserIsCreating
{ {
$this->attributes = array_merge($this->attributes, $attributes); $this->attributes = array_merge($this->attributes, $attributes);
} }
/**
* @return array
*/
public function getOriginal()
{
return $this->original;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment