Executes callbacks for a hook

@param string $name
@param array  $values

@return object
324029
public function doCallback($name, array $values = array(), $getResult = false)
    {
        $values = array_merge(
            $values,
            array($name, $this)
        );

        if ($getResult) {
            $result = $values[0];
        }

        /*
         * Hook into Wordpress if wanted.
         */
        if ($this->getConfig('hookIntoWordpress') && class_exists('\WP')) {
            $result = call_user_func_array(
                ($getResult ? 'apply_filters' : 'do_action'),
                array_merge(
                    (array) sprintf('%s_%s', $this->_name, strtolower($name)),
                    $values
                )
            );
        }

        /*
         * Do own callbacks.
         */
        if (!empty($this->_callbacks[$name])) {
            foreach ($this->_callbacks[$name] as $prio => $callbacks) {
                foreach ($callbacks as $callbackKey) {
                    if (!empty(self::$_baseRealCallbacks[$callbackKey])) {
                        if ($getResult) {
                            $values[0] = $result;
                        }
                        $result = call_user_func_array(self::$_baseRealCallbacks[$callbackKey], $values);
                    }
                }
            }
        }

        return ($getResult ? $result : $this);
    }
1167007
public static function execute($name, &$args, &$options, $called)
    {
        $moduleClass = 'Xiphe\HTML\modules\\'.ucfirst($name);

        if (is_object(self::$_loadedModules[$name])) {
            self::$_loadedModules[$name]->execute($args, $options, $called);
        } else {
            $Module = new $moduleClass();
            $Module->execute($args, $options, $called);
        }
    }
587032
public function insert(array $values): ResultInterface
    {
        $this->insert                   = $this->getTableName();
        $this->insertValues['columns']  = array_keys($values);
        $this->insertValues['values'][] = array_values($values);

        return $this->execute();
    }
654745
public function fireDB($name)
    {
        $args = func_get_args();
        array_shift($args);

        if (!isset($this->hooks[$name])) {
            //$this->hooks[$name] = array(array());
            return $args[0];
        }
        if (!empty($this->hooks[$name])) {
            // Sort by priority, low to high, if there's more than one priority
            if (count($this->hooks[$name]) > 1) {
                ksort($this->hooks[$name]);
            }

            $output = [];

            foreach ($this->hooks[$name] as $priority) {
                if (!empty($priority)) {
                    foreach ($priority as $callable) {
                        $output[] = call_user_func_array($callable, $args);
                    }
                }
            }

            return $output[0];
        }
    }
199821
private function execute($name, array $arguments)
    {
        return $this->functions[$name]->call($this->mapper, $this->connection, $this->strategies, $this->environment, $arguments, []);
    }
700576
public function allowedValues(string $name, array $values): bool
    {
        if (!$this->exists($name)) {
            throw new EnvironmentException(\sprintf('Variable %s doesn\'t exist', $name));
        }

        return \in_array($name, $values, true);
    }
945714
public function runHooks($name, AbstractContext $context, $reverse = false)
    {
        $parent = $this->getParent();
        $hooks = $this->hooks[$name];

        if ($reverse) { 
            foreach (array_reverse($hooks) as $hook) {
                $hook->run($context); 
            }
            if ($parent) {
                $parent->runHooks($name, $context, $reverse);
            }
        } else {
            if ($parent) {
                $parent->runHooks($name, $context, $reverse);
            }
            foreach ($hooks as $hook) {
                $hook->run($context); 
            }
        } 
    }
212592
public function filter(string $name, array $values): Route{
		$this->filters[$name] = $values;
		return $this;
	}
902725
public function hook($name, $callable, $priority = 10, $override = false)
    {
        if ($override) {
            $this->clearHooks($name);
        }

        return parent::hook($name, $callable, $priority);
    }
1221830
public static function call($name, $arguments = []) {
		if (self::exists($name)) {
			$application = Application::get();
			$classname = 'Hook_' . ucfirst($application->name);
			call_user_func_array([$classname, $name], $arguments);
		} else {
			throw new \Exception('Hook is not defined');
		}
	}
9968
public static function pluck(array $values, $key)
    {
        return array_map(
            function($val) use ($key) {
                return is_object($val) ? $val->{$key} : $val[$key];
            },
            $values
        );
    }
767180
public function value( $name, $value = null )
    {
        if ( is_array( $name ) ) {
            $this->values += $name;
        } elseif ( func_num_args() > 1 ) {
            $this->values[ $name ] = $value;
        }
        return $this;
    }
922440
public function set($name, $value = null)
    {
        if (!is_array($name)) {
            $this->data[$name] = $value;
        } else {
            foreach ($name as $key => $value) {
                $this->data[$key] = $value;
            }
        }
        return $this;
    }
746802
public function bind($values = [])
    {
        if (is_object($values)) {
            $values = get_object_vars($values);
        }

        if (!is_array($values)) {
            throw new \InvalidArgumentException('Please give me array or object');
        }

        foreach ($values as $key => $value) {
            $this->$key = $value;
        }

        return $this;
    }
1290892
protected function enum(string $name, array $values): Closure
    {
        $this->createEnum($name, $values);

        return $this->useEnum($name, $name, true);
    }
1165235
public function setContext($name, $value = null)
    {
        if (is_array($name)) {
            $this->context = $name + $this->context;
        } else {
            $this->context[$name] = $value;
        }
        return $this;
    }
457371
public function execute($name, array $params = [], array $headers = [])
    {
        $executor = new Executor($this);

        return $executor->run($name, $params, $headers);
    }