My\Model\UserWasCreated::username PHP Method

username() public method

public username ( ) : string
return string
        public function username()
        {
            return $this->payload['name'];
        }

Usage Example

Example #1
0
 /**
  * Each applied event needs a corresponding handler method.
  *
  * The naming convention is: when[:ShortEventName]
  *
  * @param UserWasCreated $event
  */
 protected function whenUserWasCreated(UserWasCreated $event)
 {
     //Simply assign the event payload to the appropriate properties
     $this->uuid = Uuid::fromString($event->aggregateId());
     $this->name = $event->username();
 }
UserWasCreated