I am using Laminas DoctrineObjectInputFilter
and want to get the value of other properties in the callback input filter like this code is in the init function of the Filter
class which extends DoctrineObjectInputFilter
// input filter whose value is required $this->add([ 'name' => 'name', 'allow_empty' => false, 'filters' => [] ]); // Input filter in which I want value of input name $this->add([ 'name' => 'value', 'allow_empty' => true, 'filters' => [ [ 'name' => 'Callback', 'options' => [ 'callback' => function ($value) { $name = // want to get property name value here if (key_exists($name, $this->applicationConfig) && gettype($value) === 'string') { return trim(strip_tags($value)); } else { return trim($value); } return $value; }, ], ], ], ]);
Checked $this->getRawValues()
but it returns null for all inputs.
A bit late, but I guess you are searching for
$context
. Since the value of name is in the sameInputFilter
instance, you only need to use$context
in the callback function.