code: public function hasEventHandlers($name)
      {
          $this->ensureBehaviors();
  
          foreach ($this->_eventWildcards as $wildcard => $handlers) {
              if (!empty($handlers) && StringHelper::matchWildcard($wildcard, $name)) {
                  return true;
              }
          }
  
          return !empty($this->_events[$name]) || Event::hasHandlers($this, $name);
      }
docs: Returns a value indicating whether there is any handler attached to the named event.
  @param string $name the event name
  @return bool whether there is any handler attached to the event.