lithium\aop\Filters::_chain()

protected static method

Creates a chain for given class/method combination or retrieves it from cache. Will implictly do a reverse merge to put static filters first before instance filters.

Parameters

  • string|object $class

    Fully namespaced class name or an instance of a class.

  • string $method

    The method name i.e. 'bar'.

Returns

\lithium\aop\Chain

Source

	protected static function _chain($class, $method) {
		$ids = static::_ids($class, $method);

		if (isset(static::$_chains[$ids[0]])) {
			return static::$_chains[$ids[0]];
		}
		$filters = [];

		foreach ($ids as $id) {
			if (isset(static::$_filters[$id])) {
				$filters = array_merge(static::$_filters[$id], $filters);
			}
		}
		return static::$_chains[$ids[0]] = new Chain(compact('class', 'method', 'filters'));
	}