eZ\Publish\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig PHP Method

setMatchingConfig() public method

$matchingConfig can have single (string|int...) or multiple values (array).
public setMatchingConfig ( mixed $matchingConfig )
$matchingConfig mixed
    public function setMatchingConfig($matchingConfig)
    {
        $matchingConfig = !is_array($matchingConfig) ? array($matchingConfig) : $matchingConfig;
        $this->values = array_fill_keys($matchingConfig, true);
    }

Usage Example

 public function setMatchingConfig($matchingConfig)
 {
     if (!is_array($matchingConfig)) {
         $matchingConfig = array($matchingConfig);
     }
     array_walk($matchingConfig, function (&$item) {
         $item = trim($item, '/ ');
     });
     parent::setMatchingConfig($matchingConfig);
 }