Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo::setFieldValue PHP Method

setFieldValue() public method

Sets the specified field to the specified value on the given document.
public setFieldValue ( object $document, string $field, mixed $value )
$document object
$field string
$value mixed
    public function setFieldValue($document, $field, $value)
    {
        if ($document instanceof Proxy && !$document->__isInitialized()) {
            //property changes to an uninitialized proxy will not be tracked or persisted,
            //so the proxy needs to be loaded first.
            $document->__load();
        }
        $this->reflFields[$field]->setValue($document, $value);
    }
ClassMetadataInfo