public function __construct() { parent::__construct(function (Command $command) { return $command->getAggregateRoot(); }); $this->setGetAggregateIdentifierCallback(function (Command $command) { return $command->getAggregateIdentifier(); }); }