48 parent::__construct(
$config, $reserved);
49 assert(
'is_array($config)');
53 $this->scopeAttribute =
$config->getString(
'scopeAttribute');
54 $this->sourceAttribute =
$config->getString(
'sourceAttribute');
55 $this->targetAttribute =
$config->getString(
'targetAttribute');
56 $this->onlyIfEmpty =
$config->getBoolean(
'onlyIfEmpty',
false);
66 assert(
'is_array($request)');
67 assert(
'array_key_exists("Attributes", $request)');
83 if ($this->onlyIfEmpty and count(
$attributes[$this->targetAttribute]) > 0) {
87 foreach (
$attributes[$this->scopeAttribute] as $scope) {
89 if (strpos($scope,
'@') !== FALSE) {
90 $scope = explode(
'@', $scope, 2);
94 foreach (
$attributes[$this->sourceAttribute] as $value) {
95 $value = $value .
'@' . $scope;
97 if (in_array($value,
$attributes[$this->targetAttribute], TRUE)) {
process(&$request)
Apply this filter to the request.
__construct($config, $reserved)
Initialize this filter, parse configuration.
Create styles array
The data for the language used.
static loadFromArray($config, $location='[ARRAY]', $instance=null)
Loads a configuration from the given array.