src/Application/Hook/Action.php
public function trigger ($value, $precedence = null)
		{
			if (is_null($precedence)) {
				$functions = array();

				ksort($this->hooks);

				foreach ($this->hooks as $function_set) {
					foreach ($function_set as $function) {
						$functions[] = $function;
					}
				}

				foreach ($functions as $function) {
					$value = call_user_func_array($function, array($value));
				}

				return $value;

			} else {
				if (isset($this->hooks[$precedence])) {
					foreach ($this->hooks[$precedence] as $function) {
						$value = call_user_func_array($function, array($value));
					}
				}

				return $value;
			}
		}
public function trigger ($value, $precedence = null)
		{
			if (is_null($precedence)) {
				$functions = array();

				ksort($this->hooks);

				foreach ($this->hooks as $function_set) {
					foreach ($function_set as $function) {
						$functions[] = $function;
					}
				}

				foreach ($functions as $function) {
					$value = call_user_func_array($function, array($value));
				}

				return $value;

			} else {
				if (isset($this->hooks[$precedence])) {
					foreach ($this->hooks[$precedence] as $function) {
						$value = call_user_func_array($function, array($value));
					}
				}

				return $value;
			}
		}
public function trigger ( $ value , $ precedence = null ) { if ( is_null ( $ precedence ) ) { $ functions = array ( ) ; ksort ( $ this -> hooks ) ; foreach ( $ this -> hooks as $ function_set ) { foreach ( $ function_set as $ function ) { $ functions [ ] = $ function ; } } foreach ( $ functions as $ function ) { $ value = call_user_func_array ( $ function , array ( $ value ) ) ; } return $ value ; } else { if ( isset ( $ this -> hooks [ $ precedence ] ) ) { foreach ( $ this -> hooks [ $ precedence ] as $ function ) { $ value = call_user_func_array ( $ function , array ( $ value ) ) ; } } return $ value ; } }
Invokes all hooks of a given precedence for a given event.

If null precedence is provided, invokes all hooks for a given event, regardless of precedence.

@api

@param mixed $value                      The value to be transformed.
@param mixed $precedence (default: null) If provided, only callbacks of this precedence will be executed.

@return mixed
Invokes all hooks of a given precedence for a given event .