Get the priority of an event

@param   string  The event name
@param   object  An object implementing the AnObjectHandlable interface
@return  integer|false The event priority or FALSE if the event isn't listened for.
979156
public function getEventPriority($name, AnObjectHandable $listener)
    {
        $result = false;
        
        if (isset($this->_listeners[$name])) {
            $result = $this->_listeners[$name]->getPriority($listener);
        }
        
        return $result;
    }
567023
public static function findPropertyNameStatic($name, $object)
    {
        $property = null;
        if (property_exists($object, $name)) {
            $property = $name;
        } else {
            // _name
            $underscore_name = '_'.$name;
            if (property_exists($object, $underscore_name)) {
                $property = $underscore_name;
            } else {
                // __name
                $doubleunderscore_name = '__'.$name;
                if (property_exists($object, $doubleunderscore_name)) {
                    $property = $doubleunderscore_name;
                }
            }
        }
        return $property;
    }
774332
public function countListeners($event)
    {
        if ($event instanceof EventInterface) {
            $event = $event->getName();
        }

        return isset($this->listeners[$event]) ? count($this->listeners[$event]) : 0;
    }
637509
public function getListeners(string $event) : array
    {
        if (empty($this->listeners[$event])) {
            return [];
        }

        if (! isset($this->sorted[$event])) {
            $this->sorted[$event] = $this->sortListeners($this->listeners[$event]);
        }

        return $this->sorted[$event];
    }
933677
public function trigger($event)
    {

        if (is_string($event)) {
            $event = new Event($event);
        }
        $listeners = $this->getListeners($event->name);

        if (empty($listeners)) {
            return $event;
        }

        //print_r($listeners);

        //die;

        //Priorities... the bigger the more urgent
        $urgency = ksort($listeners, SORT_NUMERIC);
        $callbacks = array_reverse($listeners, true);

        //Loop through callbacks;
        foreach ($callbacks as $priority => $listener) {
            if ($event->isStopped()) {
                break;
            }

            foreach ($listener as $callback) {
                if ($event->isStopped()) {
                    break;
                }
                $this->propergate($event, $callback);
            }
        }

        return $event;
    }
445511
@SuppressWarnings("unchecked")
public int compareTo(Object object)
   {
      if(!(object instanceof Subject))
         return -1;
      
      Subject<T> subject = (Subject<T>)object;
      
      return this.name.compareTo(subject.getName());
   }
335098
protected function getSortkeyValue($object, $valueName) {
    $value = $object->getValue($valueName);
    if ($value == null) {
      $value = $object->getOID()->getFirstId();
    }
    return $value;
  }
826584
public function once(string $eventName, callable $callBack, int $priority = 100)
    {
        $wrapper = null;
        $wrapper = function () use ($eventName, $callBack, &$wrapper) {
            $this->removeListener($eventName, $wrapper);

            return \call_user_func_array($callBack, \func_get_args());
        };

        $this->on($eventName, $wrapper, $priority);
    }
589973
protected static function getListenersSortByPriority(String $eventName) : Array
    {
        if ( ! isset(Properties::$listeners[$eventName]))
		{
			return [];
        }
        
        array_multisort(Properties::$listeners[$eventName][0], SORT_NUMERIC, Properties::$listeners[$eventName][1]);

        return Properties::$listeners[$eventName][1];
    }
484647
public function listen($event, $callable, $priority = ListenerPriority::NORMAL)
    {
        $this->getDispatcher()->listen($event, $callable, $priority);

        return $this;
    }
441715
public function getValue($object) {
		if(null === $this->reflectionClass) {
			$this->reflectionClass = new \ReflectionClass($this->class);
		}
		$method = $this->reflectionClass->getMethod($this->getter);
		return $method->invoke($object);
	}
1001388
public function setEventPriority($name, AnObjectHandable $listener, $priority)
    {
        if (isset($this->_listeners[$name])) {
            $this->_listeners[$name]->setPriority($listener, $priority);
        }
        
        return $this;
    }
484362
public function on($event_name, $callback, $priority = 100) {
	    	if(!is_callable($callback)){
	    		throw new \InvalidArgumentException("Argument 'callback' is not callable.");
	    	}

	        if (!isset($this->listeners[$event_name])) {
	            $this->listeners[$event_name] = array(
	                true,  // If there's only one item, it's sorted
	                array($priority),
	                array($callback)
	            );
	        } else {
	            $this->listeners[$event_name][0] = false; // marked as unsorted
	            $this->listeners[$event_name][1][] = $priority;
	            $this->listeners[$event_name][2][] = $callback;
	        }
	    }
888865
public function priority($priority)
    {
        if (!$this->isNumber($priority)) {
            throw new EventManagerException(EventManagerException::MSG_INVALID_ARG, [
                    '$priority',
                    'integer'
                ]
            );
        }

        if ($priority <= 100 || $priority >= 1000) {
            throw new EventManagerException(EventManagerException::INVALID_PRIORITY_VALUE);
        }
        $this->priority = $priority;

        return $this;
    }
476882
public function getListenerPriority($listener, $event)
	{
		$event = $this->resolveEventName($event);

		if (isset($this->listeners[$event]))
		{
			return $this->listeners[$event]->getPriority($listener);
		}

		return null;
	}
1304146
public function on($eventName, $callback, $priority = 0)
    {
        if ($this->booted) {
            $this->container['event_dispatcher']->addListener($eventName, $this->container['callback_resolver']->resolveCallback($callback), $priority);

            return;
        }

        $this->container->extend('event_dispatcher', function ($dispatcher, $c) use ($callback, $priority, $eventName) {
            $dispatcher->addListener($eventName, $c['callback_resolver']->resolveCallback($callback), $priority);

            return $dispatcher;
        });
    }
1135116
public function indexOf( common_Object $object)
    {
        $returnValue = (int) 0;

        
    	$returnValue = -1;
        foreach($this->sequence as $index => $_object){
			if($object === $_object){
				return $index;
			}
		}
        

        return (int) $returnValue;
    }