src/Event/Event.php
private function hasUncommittedEvents()
    {
        $reflector = new \ReflectionClass(EventSourcedAggregateRoot::class);
        $property = $reflector->getProperty('uncommittedEvents');

        $property->setAccessible(true);
        $uncommittedEvents = $property->getValue($this);

        return !empty($uncommittedEvents);
    }
private function hasUncommittedEvents()
    {
        $reflector = new \ReflectionClass(EventSourcedAggregateRoot::class);
        $property = $reflector->getProperty('uncommittedEvents');

        $property->setAccessible(true);
        $uncommittedEvents = $property->getValue($this);

        return !empty($uncommittedEvents);
    }
private function hasUncommittedEvents ( ) { $ reflector = new \ ReflectionClass ( EventSourcedAggregateRoot :: class ) ; $ property = $ reflector -> getProperty ( 'uncommittedEvents' ) ; $ property -> setAccessible ( true ) ; $ uncommittedEvents = $ property -> getValue ( $ this ) ; return ! empty ( $ uncommittedEvents ) ; }
Use reflection to get check if the aggregate has uncommitted events.
@return bool
Use reflection to get check if the aggregate has uncommitted events .