Set field value.

@param bool  $value
@param mixed $junk
552954
public function set($value = null, $junk = null)
    {
        if (!is_bool($value)) {
            throw new Exception(['Field\CheckBox::set() needs value to be a boolean', 'value'=>$value]);
        }

        parent::set($value);
    }
454169
public function setValue($value) : void
    {
        if (is_object($value) && !($value instanceof ArrayObject)) {
            $this->class = $value;
            if (isset($this->value)) {
                $old = clone $this->value;
                $work = clone $value;
                if ($work instanceof JsonSerializable) {
                    $work = $work->jsonSerialize();
                }
                foreach ($work as $prop => $status) {
                    $value->$prop = isset($old->$prop) ? $old->$prop : false;
                }
            }
            $this->value = $value;
        }
        if (!isset($this->value)) {
            $this->value = clone $this->class;
        }
        if (is_array($value) || $value instanceof ArrayObject) {
            $work = clone $this->value;
            if ($work instanceof JsonSerializable) {
                $work = $work->jsonSerialize();
            }
            foreach ($work as $prop => $status) {
                $this->value->$prop = false;
            }
            foreach ($value as $prop) {
                if (is_string($prop) && $this->hasBit($prop) && isset($this->value->$prop)) {
                    $this->value->$prop = true;
                }
            }
        }
        $found = [];
        foreach ((array)$this as $element) {
            if ($element->getElement() instanceof Hidden) {
                continue;
            }
            $check = $element->getElement()->getValue();
            if (isset($this->value->$check) && $this->value->$check) {
                $element->getElement()->check();
            } else {
                $element->getElement()->check(false);
            }
            $found[] = $check;
        }
    }
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, '', '');
    	}
        
    }
135759
public function setValue($value)
    {
        if ((\is_bool($value))) {
            $this->value = (bool) $value;
        } elseif (\is_object($value) && $value instanceof self) {
            $this->value = $value->getValue();
        } else {
            throw new \InvalidArgumentException('Expected boolean');
        }
    }
1274422
public function setNewValue($field, $value)
    {
        $this->assertValidField($field);

        $this->documentChangeSet[$field][1] = $value;
    }
150671
public function offsetSet ($offset, $value) {
        if ($offset === NULL) {
            $this->data[] = $value;
        } else {
            $this->data[$offset] = $value;
        }
    }
1209084
public function setFieldValue($object, $field, $value)
    {
        $this->assertObjectInstance($object);

        return $this->getField($field)->set($object, $value);
    }
1083245
public function setValue($value, $record = null)
    {
        FrontendEditing::setValue($this, $value, $record);
        parent::setValue($value, $record);
    }
317736
function setValue($value)
    {
        $this->setChecked(isset($this->_values[1]) && $value == $this->_values[1]);
        $this->_currentValue = $value;
    }
664079
public function setValue($value, $record = null) {
		if ($value != $this->value) {
			$this->changed = true;
		}
		$this->value = $value;
	}
736187
public function setNewValue(string $field, $value) : void
    {
        $this->assertValidField($field);

        $this->entityChangeSet[$field][1] = $value;
    }
747779
public function setNewValue(string $field, $value) : void
    {
        $this->assertValidField($field);

        $this->documentChangeSet[$field][1] = $value;
        $this->getDocumentManager()->getUnitOfWork()->setDocumentChangeSet($this->getDocument(), $this->documentChangeSet);
    }
633259
public function setValue($value)
    {
        $this->value = [];

        $token = ' ,;';
        $values = strtok($value, $token);

        while ($values !== false) {
            $this->value[] = $values;
            $values = strtok($token);
        }
    }
417647
public function set(string $field, $value): Update
    {
        $this->what[$field] = $value;
        return $this;
    }
806404
public final function set($field, $value) {
        // This is a legacy change to the way files are get/set.
        // Make sure we never save the \stored_file object. Instead, use the id from $file->get_id() - set_file() does this for us.
        if ($field === 'file') {
            $this->set_file($value);
            return true;
        }
        if (property_exists($this, $field)) {
            $this->{$field} =& $value;
            $this->dirty = true;
            return true;
        }
        $a = (object)array('property' => $field, 'class' => get_class($this));
        if ($this->get('exporter')) {
            throw new portfolio_export_exception($this->get('exporter'), 'invalidproperty', 'portfolio', null, $a);
        }
        throw new portfolio_exception('invalidproperty', 'portfolio', null, $a); // this happens outside export (eg admin settings)

    }
20722
private void set(FieldType field, boolean value)
   {
      set(field, (value ? Boolean.TRUE : Boolean.FALSE));
   }
1112795
public function setFieldValue(string $field, int $value) : bool
        {
                return $this->_redis->zadd($this->_key, $value, $field) > 0 ? true : false;
        }