src/AbstractNodeCommandHandler.php
protected function createEventFromCommand(Command $command, string $suffix): Event
    {
        /** @var NodeRef $nodeRef */
        $nodeRef = $command->get('node_ref') ?: NodeRef::fromNode($command->get('node'));
        $curie = $command::schema()->getCurie();
        $eventCurie = "{$curie->getVendor()}:{$curie->getPackage()}:event:{$nodeRef->getLabel()}-{$suffix}";

        /** @var Event $class */
        $class = MessageResolver::resolveCurie(SchemaCurie::fromString($eventCurie));
        return $class::create();
    }
protected function createEventFromCommand(Command $command, string $suffix): Event
    {
        /** @var NodeRef $nodeRef */
        $nodeRef = $command->get('node_ref') ?: NodeRef::fromNode($command->get('node'));
        $curie = $command::schema()->getCurie();
        $eventCurie = "{$curie->getVendor()}:{$curie->getPackage()}:event:{$nodeRef->getLabel()}-{$suffix}";

        /** @var Event $class */
        $class = MessageResolver::resolveCurie(SchemaCurie::fromString($eventCurie));
        return $class::create();
    }
protected function createEventFromCommand ( Command $ command , string $ suffix ) : Event { /** @var NodeRef $nodeRef */ $ nodeRef = $ command -> get ( 'node_ref' ) ? : NodeRef :: fromNode ( $ command -> get ( 'node' ) ) ; $ curie = $ command :: schema ( ) -> getCurie ( ) ; $ eventCurie = "{$curie->getVendor()}:{$curie->getPackage()}:event:{$nodeRef->getLabel()}-{$suffix}" ; /** @var Event $class */ $ class = MessageResolver :: resolveCurie ( SchemaCurie :: fromString ( $ eventCurie ) ) ; return $ class :: create ( ) ; }
90% of the time this works 100% of the time.  When events for common
node operations match the convention of "blah-suffix" you can use
this method to save some typing.  It's always optional.

@param Command $command
@param string  $suffix

@return Event
90% of the time this works 100% of the time . When events for common node operations match the convention of blah - suffix you can use this method to save some typing . It s always optional .