class CustomFilter in Custom filter 6.2
@file Allow users to define custom filters.
Hierarchy
- class \CustomFilter implements \ArrayAccess
Expanded class hierarchy of CustomFilter
File
- ./
customfilter.module, line 8 - Allow users to define custom filters.
View source
class CustomFilter implements ArrayAccess {
const API_VERSION = '2.1';
const API_MINIMUM_VERSION = '2.1';
private static $instance;
private $vars = array();
public function __call($name, $arguments) {
$flist = array();
foreach (module_implements('customfilter_api') as $module) {
$result = module_invoke($module, 'customfilter_api');
$bool = array(
isset($result) && is_array($result) && isset($result['version']) && version_compare($result['version'], self::API_MINIMUM_VERSION, '>') && version_compare($result['version'], self::API_VERSION, '<'),
);
if ($bool) {
$result = module_invoke($module, 'customfilter_function_info');
if (isset($result) && is_array($result)) {
$flist = array_merge($flist, $result);
}
}
}
if (isset($flist[$name])) {
$result = call_user_func_array($flist[$name]['function'], $arguments);
if (isset($result)) {
return $result;
}
else {
return '';
}
}
else {
return '';
}
}
private function __clone() {
}
private function __construct() {
}
public function __get($name) {
return isset($this->vars[$name]) ? $this->vars[$name] : NULL;
}
public function __isset($name) {
return isset($this->vars[$name]);
}
public function __set($name, $value) {
$this->vars[$name] = $value;
}
public function __unset($name) {
unset($this->vars[$name]);
}
public function offsetExists($offset) {
return isset($this->vars[$offset]);
}
public function offsetGet($offset) {
return isset($this->vars[$offset]) ? $this->vars[$offset] : NULL;
}
public function offsetSet($offset, $value) {
$this->vars[$offset] = $value;
}
public function offsetUnset($offset) {
unset($this->vars[$offset]);
}
public static function singleton() {
if (!isset(self::$instance)) {
self::$instance = new CustomFilter();
}
return self::$instance;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CustomFilter:: |
private static | property | ||
CustomFilter:: |
private | property | ||
CustomFilter:: |
constant | |||
CustomFilter:: |
constant | |||
CustomFilter:: |
public | function | ||
CustomFilter:: |
public | function | ||
CustomFilter:: |
public | function | ||
CustomFilter:: |
public | function | ||
CustomFilter:: |
public static | function | ||
CustomFilter:: |
public | function | ||
CustomFilter:: |
private | function | ||
CustomFilter:: |
private | function | ||
CustomFilter:: |
public | function | ||
CustomFilter:: |
public | function | ||
CustomFilter:: |
public | function | ||
CustomFilter:: |
public | function |