49 parent::__construct(
$config, $reserved);
54 $this->scopeAttribute =
$config->getString(
'scopeAttribute');
55 $this->sourceAttribute =
$config->getString(
'sourceAttribute');
56 $this->targetAttribute =
$config->getString(
'targetAttribute');
57 $this->onlyIfEmpty =
$config->getBoolean(
'onlyIfEmpty',
false);
69 assert(array_key_exists(
'Attributes',
$request));
85 if ($this->onlyIfEmpty && count(
$attributes[$this->targetAttribute]) > 0) {
89 foreach (
$attributes[$this->scopeAttribute] as $scope) {
90 if (strpos($scope,
'@') !==
false) {
91 $scope = explode(
'@', $scope, 2);
95 foreach (
$attributes[$this->sourceAttribute] as $value) {
96 $value = $value .
'@' . $scope;
98 if (in_array($value,
$attributes[$this->targetAttribute],
true)) {
foreach($paths as $path) $request
process(&$request)
Apply this filter to the request.
__construct($config, $reserved)
Initialize this filter, parse configuration.
if(array_key_exists('yes', $_REQUEST)) $attributes
static loadFromArray($config, $location='[ARRAY]', $instance=null)
Loads a configuration from the given array.