public function setWhitelist($whitelist)
    {
        if (is_array($whitelist)) {
            $this->whitelist = array_map('strval', $whitelist);
        } elseif ($whitelist instanceof \ArrayObject && true) {
            $this->whitelist = array_map('strval', $whitelist->getArrayCopy());
        } elseif (is_string($whitelist)) {
            $this->whitelist = [];
            for ($i = 0; $i < strlen($whitelist); $i++) {
                $this->whitelist[] = $whitelist[$i];
            }
        } else {
            throw new \Exception('Incorrect whitelist given. Allowed whitelist are: string, array or ArrayObject.');
        }
    }
public function setWhitelist($whitelist)
    {
        if (is_array($whitelist)) {
            $this->whitelist = array_map('strval', $whitelist);
        } elseif ($whitelist instanceof \ArrayObject && true) {
            $this->whitelist = array_map('strval', $whitelist->getArrayCopy());
        } elseif (is_string($whitelist)) {
            $this->whitelist = [];
            for ($i = 0; $i < strlen($whitelist); $i++) {
                $this->whitelist[] = $whitelist[$i];
            }
        } else {
            throw new \Exception('Incorrect whitelist given. Allowed whitelist are: string, array or ArrayObject.');
        }
    }
public function setWhitelist ( $ whitelist ) { if ( is_array ( $ whitelist ) ) { $ this -> whitelist = array_map ( 'strval' , $ whitelist ) ; } elseif ( $ whitelist instanceof \ ArrayObject && true ) { $ this -> whitelist = array_map ( 'strval' , $ whitelist -> getArrayCopy ( ) ) ; } elseif ( is_string ( $ whitelist ) ) { $ this -> whitelist = [ ] ; for ( $ i = 0 ; $ i < strlen ( $ whitelist ) ; $ i ++ ) { $ this -> whitelist [ ] = $ whitelist [ $ i ] ; } } else { throw new \ Exception ( 'Incorrect whitelist given. Allowed whitelist are: string, array or ArrayObject.' ) ; } }
Set the whitelist of characters which are allowed for this field.
This can either be an array or a string.

@param array|\ArrayObject|string $whitelist
@throws \Exception
Set the whitelist of characters which are allowed for this field . This can either be an array or a string .