public function isMatchedBy(DomainMessage $domainMessage): bool
    {
        if ($this->aggregateRootTypes) {
            throw new CriteriaNotSupportedException(
                'Cannot match criteria based on aggregate root types.'
            );
        }

        if ($this->aggregateRootIds && !in_array($domainMessage->getId(), $this->aggregateRootIds)) {
            return false;
        }

        if ($this->eventTypes && !in_array($domainMessage->getType(), $this->eventTypes)) {
            return false;
        }

        return true;
    }
public function isMatchedBy(DomainMessage $domainMessage): bool
    {
        if ($this->aggregateRootTypes) {
            throw new CriteriaNotSupportedException(
                'Cannot match criteria based on aggregate root types.'
            );
        }

        if ($this->aggregateRootIds && !in_array($domainMessage->getId(), $this->aggregateRootIds)) {
            return false;
        }

        if ($this->eventTypes && !in_array($domainMessage->getType(), $this->eventTypes)) {
            return false;
        }

        return true;
    }
public function isMatchedBy ( DomainMessage $ domainMessage ) : bool { if ( $ this -> aggregateRootTypes ) { throw new CriteriaNotSupportedException ( 'Cannot match criteria based on aggregate root types.' ) ; } if ( $ this -> aggregateRootIds && ! in_array ( $ domainMessage -> getId ( ) , $ this -> aggregateRootIds ) ) { return false ; } if ( $ this -> eventTypes && ! in_array ( $ domainMessage -> getType ( ) , $ this -> eventTypes ) ) { return false ; } return true ; }
Determine if a domain message is matched by this criteria.

@param DomainMessage $domainMessage

@return bool
Determine if a domain message is matched by this criteria .