PHP Class My\Model\User

Inheritance: extends Prooph\EventSourcing\AggregateRoot
Mostra file Open project: prooph/event-sourcing Class Usage Examples

Public Methods

Method Description
changeName ( $newName )
name ( ) : string
nameNew ( string $username ) : User ARs should be created via static factory methods
userId ( ) : Rhumsaa\Uuid\Uuid

Protected Methods

Method Description
aggregateId ( ) : string Every AR needs a hidden method that returns the identifier of the AR as a string
whenUserWasCreated ( UserWasCreated $event ) Each applied event needs a corresponding handler method.
whenUserWasRenamed ( UserWasRenamed $event )

Method Details

aggregateId() protected method

Every AR needs a hidden method that returns the identifier of the AR as a string
protected aggregateId ( ) : string
return string representation of the unique identifier of the aggregate root

changeName() public method

public changeName ( $newName )
$newName

name() public method

public name ( ) : string
return string

nameNew() public static method

ARs should be created via static factory methods
public static nameNew ( string $username ) : User
$username string
return User

userId() public method

public userId ( ) : Rhumsaa\Uuid\Uuid
return Rhumsaa\Uuid\Uuid

whenUserWasCreated() protected method

The naming convention is: when[:ShortEventName]
protected whenUserWasCreated ( UserWasCreated $event )
$event UserWasCreated

whenUserWasRenamed() protected method

protected whenUserWasRenamed ( UserWasRenamed $event )
$event UserWasRenamed