Sets a raw value coming from a mimedir (iCalendar/vCard) file.

This has been 'unfolded', so only 1 line will be passed. Unescaping is
not yet done, but parameters are not included.

@param string $val
197105
public function setRawMimeDirValue($val)
    {
        // Normally we don't need to do any type of unescaping for these
        // properties, however.. we've noticed that Google Contacts
        // specifically escapes the colon (:) with a blackslash. While I have
        // no clue why they thought that was a good idea, I'm unescaping it
        // anyway.
        //
        // Good thing backslashes are not allowed in urls. Makes it easy to
        // assume that a backslash is always intended as an escape character.
        if ('URL' === $this->name) {
            $regex = '#  (?: (\\\\ (?: \\\\ | : ) ) ) #x';
            $matches = preg_split($regex, $val, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
            $newVal = '';
            foreach ($matches as $match) {
                switch ($match) {
                    case '\:':
                        $newVal .= ':';
                        break;
                    default:
                        $newVal .= $match;
                        break;
                }
            }
            $this->value = $newVal;
        } else {
            $this->value = strtr($val, ['\,' => ',']);
        }
    }
237660
private static function normalize(&$val) : void
    {
        if (is_array($val)) {
            array_walk($val, [__CLASS__, 'normalize']);
        } elseif (is_scalar($val)) {
            $val = strlen($val) ? $val : null;
        }
    }
1224872
private function setAutoMode($val) {
        $this->_defaultBehaviour           = $val;
        $_SESSION[$this->_sessionAutoName] = $this->_defaultBehaviour;
    }
200436
public function setAttribute( $attr, $val )
    {
        $def = $this->definition();
        $fields = $def["fields"];
        $functions = isset( $def["set_functions"] ) ? $def["set_functions"] : null;
        if ( isset( $fields[$attr] ) )
        {
            $attrName = $fields[$attr];
            if ( is_array( $attrName ) )
            {
                $attrName = $attrName['name'];
            }

            $oldValue = null;
            if ( isset( $this->$attrName ) )
                $oldValue = $this->$attrName;
            $this->$attrName = $val;
            if ( $oldValue === null ||
                 $oldValue !== $val )
                $this->setHasDirtyData( true );
        }
        else if ( isset( $functions[$attr] ) )
        {
            $functionName = $functions[$attr];
            $oldValue = $this->$functionName( $val );
            if ( $oldValue === null or $oldValue !== $val )
                $this->setHasDirtyData( true );
        }
        else
        {
            eZDebug::writeError( "Undefined attribute '$attr', cannot set",
                                 $def['class_name'] );
        }
    }
574337
public function setValue($value)
    {
        
    	if ($value instanceof tao_helpers_form_data_UploadFileDescription){
    		// The file is being uploaded.
    		$this->value = $value;
    	} elseif (!is_null($value)) {
    		// The file has already been uploaded
    		$this->value = new tao_helpers_form_data_StoredFileDescription($value);
    	}
    	else{
    		// Empty file upload description, nothing was uploaded.
    		$this->value = new tao_helpers_form_data_UploadFileDescription('', 0, '', '');
    	}
        
    }
469911
public static function set($name, $val)
    {

        if (!is_string($name)) {
            throw new \Exception('Cache key must be a string.');
        }

        // Connect if not connected
        if (self::$config['memcached']['enabled']) {
            self::memcachedConnect();
        }

        if (is_null($val)) {
            // If $val is null, remove from cache
            unset(self::$cache[$name]);

            // Remove from memcached
            if (self::$config['memcached']['enabled']) {
                self::$memcached->delete($name);
            }
        } else {
            // Store in php-memory cache
            self::$cache[$name] = $val;

            // Store in memcached
            if (self::$config['memcached']['enabled']) {
                self::$memcached->set($name, $val);
            }
        }
    }
362555
protected static function setPath(&$m, $path, $val)
    {
        foreach ($path as $p) {
            $m =& $m[$p];
        }
        $m = $val;
    }
929398
function offsetset($key,$val) {
		return Base::instance()->visible($this,$key)?
			($this->$key=$val):$this->set($key,$val);
	}
280540
public function setData($data)
    {
        $this->valid = false;
        $this->hash = md5($data, false);
        $this->rawData = explode("\n", $data);
    }
728374
function Parse($val)
    {
		$pair = explode("<",$val);

		if (isset($pair[1]))
		{
			$this->RealName = trim($pair[0]);
			$this->Email = trim( str_replace(">","",$pair[1]) );
		}
		else
		{
			$this->Email = $val;
			$this->RealName = $val;
		}

		// just in case there was no realname
		if ($this->RealName == "") $this->RealName = $this->Email;

	}
570884
public function setParam($name, $val)
    {
        if ( ! is_string($name) || ! is_string($val)) {
            return;
        }
        $this->data[$name] = $val;

        return $this;
    }
779231
public function storageVal($val)
    {
        $mode = $this->storageMode();

        if ($mode === self::STORAGE_MODE_INT) {
            return $this->intVal($val);
        } else {
            return $this->stringVal($val);
        }
    }
187358
public final function set ($key, $val)
    {
        if (in_array($key, $this->getColumn())) {
            $this->record->{$key} = $val;
            return true;
        }

        return false;
    }
720277
protected function setGenesisStatusDate($val)
    {
        $val = $this->cleanDateTimeValue($val);
        $this->validateReadOnly('genesisStatusDate', $val);
        return $this->_setAttribute('genesisStatusDate', $val);
    }
239037
public function setParam($key, $val)
    {
        switch ($key) {
        case 'password':
            if ($val instanceof Horde_Imap_Client_Base_Password) {
                break;
            }

            // DEPRECATED: Encrypt password.
            try {
                $encrypt_key = $this->_getEncryptKey();
                if (strlen($encrypt_key)) {
                    $secret = new Horde_Secret();
                    $val = $secret->write($encrypt_key, $val);
                    $this->_params['_passencrypt'] = true;
                }
            } catch (Exception $e) {}
            break;
        }

        $this->_params[$key] = $val;
        $this->changed = true;
    }
426034
public function offsetSet($index, $val)
    {
        $val = (string) $val;
        $this->value = \mb_substr($this->value, 0, $index) . $val . \mb_substr($this->value, $index);
        $this->length += \mb_strlen($val);
    }
514226
function setValue( $value )
    {
        $this->Value = $value;
        if ( $value instanceof ggWebservicesFault || $value instanceof eZSOAPFault )
        {
            $this->IsFault = true;
            $this->FaultCode = $value->faultCode();
            $this->FaultString = $value->faultString();
        }
        else
        {
            $this->IsFault = false;
        }
    }