Clears all triggers for a given event.

@param string $eventNameOrClass The event name or class of event

@return Events
558995
public function clearTriggers($eventNameOrClass)
    {
        if (isset($this->events[$eventNameOrClass])) {
            unset($this->events[$eventNameOrClass]);
        }

        return $this;
    }
28675
public function removeAllListeners($event_name = null) {
	        if (!is_null($event_name)) {
	            unset($this->listeners[$event_name]);
	        } else {
	            $this->listeners = array();
	        }
	    }
1083038
public function removeSkipEvents ($event_name_list) {
		foreach ($event_name_list as $event_name) {
			if (isset($this->_skipEvents[$event_name])) {
				unset($this->_skipEvents[$event_name]);
			}
		}
	}
393895
public function onClear($eventArgs)
    {
        parent::onClear($eventArgs);

        $aliases = array_keys($this->identifierMap);

        $this->identifierMap = array_fill_keys($aliases, []);
    }
1164474
protected function triggerHandlers(EventInterface $event)
    {
        foreach ($this->getHandlers($event->getName()) as $handler) {
            call_user_func($handler, $event);
            if ($event->isPropagationStopped()) {
                break;
            }
        }
    }
1234639
private function getChildEvents(string $eventClass, iterable $eventClasses): iterable
    {
        $reflection = new ReflectionClass($eventClass);
        foreach ($eventClasses as $curEventClass) {
            $curReflection = new ReflectionClass($curEventClass);
            if ($curReflection->isAbstract() === false) {
                if ($eventClass === $curEventClass ||
                    $curReflection->isSubclassOf($eventClass) === true ||
                    ($reflection->isInterface() === true && $curReflection->implementsInterface($eventClass))
                ) {
                    yield $curEventClass;
                }
            }
        }
    }
497672
public function getEventManager()
    {
        if (!$this->eventManager instanceof EventManagerInterface) {
            $this->setEventManager(new EventManager(array(__CLASS__, get_called_class())));
        }
        return $this->eventManager;
    }
1172007
public function setEventManager(EventManagerInterface $events)
    {
        $identifiers = array('Social');
        $events->setIdentifiers($identifiers);
        $this->eventManager = $events;

        return $this;
    }
154428
function clearEventHandlers($event = null)
	{
		if (!empty($event)) {
			$this->_events[$event] = array();
		}
		else {
			$this->_events = array();
		}
	}
224490
public function clear($class)
    {
        $concrete = $this->getAlias($class);
        unset($this->_aliases[$class]);

        unset($this->_definitions[$concrete], $this->_singletons[$concrete]);
    }
793454
public static function clear(string $event = '') {
		if (empty($event)) {
			self::$events = [];
		} else {
			self::$events[$event] = [];
		}
	}
771637
private function getEventSubscribers(iterable $eventClasses, iterable $handlerClasses): iterable
    {
        foreach ($handlerClasses as $handlerClass) {
            foreach ($this->selectEvenHandlers($handlerClass) as $eventClass => $subscriber) {
                foreach ($this->getChildEvents($eventClass, $eventClasses) as $childEventClass) {
                    yield $childEventClass => $subscriber;
                }
            }
        }
    }
873630
public function preRemove(LifecycleEventArgs $eventArgs)
    {
        $em = $eventArgs->getEntityManager();
        $uow = $em->getUnitOfWork();
        $entity = $eventArgs->getEntity();

        $classMetadata = $em->getClassMetadata(get_class($entity));
        if ($this->isBlameable($classMetadata)) {
            if (!$entity->isBlameable()) {
                return;
            }
            $user = $this->getUser();
            if ($this->isValidUser($user)) {
                $oldValue = $entity->getDeletedBy();
                $entity->setDeletedBy($user);
                $uow->propertyChanged($entity, 'deletedBy', $oldValue, $user);

                $uow->scheduleExtraUpdate($entity, [
                    'deletedBy' => [$oldValue, $user],
                ]);
            }
        }
    }
603634
public function removeListener($eventName, $listener = null)
    {
        $eventName = $this->cleanEventName($eventName);

        if (!array_key_exists($eventName, $this->_list)) {
            return false;
        }

        foreach ($this->_list[$eventName] as $index => $eventData) {

            if ($eventData[1] === $listener) {
                unset($this->_list[$eventName][$index]);
                return true;
            }
        }

        return false;
    }
248184
public function withDefaultThrowableEvent(string $eventClass): self
    {
        if (false === \is_a($eventClass, ExecutionFailedEvent::class, true))
        {
            throw new InvalidEventType(
                \sprintf(
                    'Event class "%s" must implement "%s" interface',
                    $eventClass,
                    ExecutionFailedEvent::class
                )
            );
        }

        $defaultValidationFailedEvent = $this->defaultValidationFailedEvent;

        /**
         * @psalm-var class-string $eventClass
         * @psalm-var class-string|null $defaultValidationFailedEvent
         */

        return new self(
            $this->isEventListener,
            $this->isCommandHandler,
            $this->validationEnabled,
            $this->validationGroups,
            $defaultValidationFailedEvent,
            $eventClass
        );
    }
209372
function clearGlobalEventHandlers($event = null)
	{
		if (!empty($event)) {
			$this->_globalEvents[$event] = array();
		}
		else {
			$this->_globalEvents = array();
		}
	}
1285895
boolean remove(Class<?> eventClass, ListenerReferenceHolder listener) {
		lock.readLock().lock();
		TreeSet<ListenerReferenceHolder> set = listeners.get(eventClass);
		if (set != null) {
			lock.readLock().unlock();
			lock.writeLock().lock();
			try {
				return removeListenerAndSetIfNeeded(eventClass, listener, set);
			} finally {
				lock.writeLock().unlock();
			}
		}
		lock.readLock().unlock();
		return false;
	}