Update the value of the entity.

@param BusinessPage $entity
@param string       $field
@param string       $value

@return mixed
6868
protected function setEntityAttributeValue($entity, $field, $value)
    {
        $functionName = 'set'.ucfirst($field);

        call_user_func([$entity, $functionName], $value);
    }
548526
public function loadBy($field, $value)
    {
        // store
        $field = $this->getField($field);
        $system = $field->system;
        $default = $field->default;

        // add condition and load record
        $this->addCondition($field, $value);

        try {
            $this->loadAny();
        } catch (\Exception $e) {
            // restore
            array_pop($this->conditions);
            $field->system = $system;
            $field->default = $default;

            throw $e;
        }

        // restore
        array_pop($this->conditions);
        $field->system = $system;
        $field->default = $default;

        return $this;
    }
499841
protected function getEntityAttributeValue($entity, $field)
    {
        $functionName = 'get'.ucfirst($field);

        $fieldValue = call_user_func([$entity, $functionName]);

        return $fieldValue;
    }
1076718
public function set($field, $value = null , $insert = true, $update = true)
    {

        if (is_array($field)) {
            foreach ($field as $key=>$val) {
                $this->set($key, $val, $insert, $update);
            }
        }

        $this->add($field, '', 'auto');
        if ($insert)
            $this->field($field)->insertValue($value);

        if ($update)
            $this->field($field)->updateValue($value);

    }
641723
public function updateAction(Request $request, $id)
    {
        $em = $this->getDoctrine()->getManager();

        /** @var BusinessTemplate $pagePattern */
        $pagePattern = $em->getRepository('VictoireBusinessPageBundle:BusinessTemplate')->find($id);

        if (!$pagePattern) {
            throw $this->createNotFoundException('Unable to find BusinessTemplate entity.');
        }

        $editForm = $this->createEditForm($pagePattern);
        $editForm->handleRequest($request);

        if ($editForm->isValid()) {
            $em->flush();

            //redirect to the page of the template
            $completeUrl = $this->generateUrl('victoire_business_template_show', ['id' => $pagePattern->getId()]);
            $message = $this->get('translator')->trans('victoire.business_template.edit.success', [], 'victoire');

            $success = true;
        } else {
            $success = false;
            $completeUrl = null;
            $message = $this->get('translator')->trans('victoire.business_template.edit.error', [], 'victoire');
        }

        return new JsonResponse([
            'success' => $success,
            'url'     => $completeUrl,
            'message' => $message,
        ]);
    }
575759
public function updateEntityById($entity, $bind, $id)
    {
        $tbl = $this->_resource->getTableName($entity);
        if ($bind instanceof Data) {
            $data = $bind->get();
        } else {
            $data = $bind;
        }
        $where = '1';
        foreach ($id as $field => $value) {
            $where .= " AND $field=" . $this->_conn->quote($value);
        }
        $result = $this->_conn->update($tbl, $data, $where);
        return $result;
    }
112109
public function update(Entity $entity)
    {
        if (!$this->events->shouldExecute($entity, 'before', 'update')) {
            return false;
        }
        $result = $this->doUpdate($entity);
        $this->events->shouldExecute($entity, 'after', 'update');
        return $result;
    }
1079900
public function update(EntityContract $entity, Bag $parameters)
    {
        if (is_object($parameters->get($this->name)) || is_array($parameters->get($this->name))) {
            $parameters->set($this->name, Yaml::dump($parameters));
        }

        return parent::update($entity, $parameters);
    }
729954
public function updateNonTranslatableField(
        Field $field,
        StorageFieldValue $value,
        $contentId
    ) {
        // Note, no need to care for language_id here, since Content->$alwaysAvailable
        // cannot change on update
        $q = $this->dbHandler->createUpdateQuery();
        $this->setFieldUpdateValues($q, $value);
        $q->where(
            $q->expr->lAnd(
                $q->expr->eq(
                    $this->dbHandler->quoteColumn('contentclassattribute_id'),
                    $q->bindValue($field->fieldDefinitionId, null, \PDO::PARAM_INT)
                ),
                $q->expr->eq(
                    $this->dbHandler->quoteColumn('contentobject_id'),
                    $q->bindValue($contentId, null, \PDO::PARAM_INT)
                ),
                $q->expr->eq(
                    $this->dbHandler->quoteColumn('version'),
                    $q->bindValue($field->versionNo, null, \PDO::PARAM_INT)
                )
            )
        );
        $q->prepare()->execute();
    }
736187
public function setNewValue(string $field, $value) : void
    {
        $this->assertValidField($field);

        $this->entityChangeSet[$field][1] = $value;
    }
248300
public function setField($field,$value='') {
        if(is_array($field)) {
            $data           =   $field;
        }else{
            $data[$field]   =   $value;
        }
        return $this->save($data);
    }
1320630
public function update(EntityContract $entity, Bag $parameters)
    {
        $errors = new Collection();

        $default = null;

        if (!$parameters->has($this->name) && !$entity->exists) {
            $default = $this->getDefault($entity);

            if ($default !== null) {
                $parameters->set($this->name, $default);
            }

        }


        // Skip check fillable if has a default value
        if (!$this->getFillable() && $default === null) {
            return $errors;
        }

        $errors = $errors->merge($this->authorize(Tokens::PERMISSION_FILL, $entity, $parameters));
        $errors = $errors->merge($this->validate($entity, $parameters));
        $errors = $errors->merge($this->fill($entity, $parameters));

        return $errors;
    }
175792
protected function updateRow(AbstractEntity $entity)
    {
        $values = $entity->getDbValues();

        $query = $this->getSqlObject()
            ->update()
            ->set($values)
            ->where($this->getPrimaryKeyWheres($entity));

        $this->execute($query);
    }
382762
function(field, value) {
        if (field in this) {
            if (this.get(field) !== value && !([
                null,
                undefined
            ].indexOf(this.get(field)) > -1 && [
                null,
                undefined
            ].indexOf(value) > -1)) {
                if (CRUD.EntityManager.entities[this.getType()].autoSerialize.indexOf(field) > -1) {
                    if (JSON.stringify(this.get(field)) != JSON.stringify(value)) {
                        this.__dirtyValues__[field] = value;
                    }
                } else {
                    this.__dirtyValues__[field] = value;
                }
            }
        } else {
            CRUD.log('Could not find field \'' + field + '\' in \'' + this.getType() + '\' (for set)');
        }
    }
1091741
public function applyAttribute(Entity $entity, $fieldKey, $value)
    {
        $entity->addAttribute($this->createAttribute($fieldKey, $value));
        return $this;
    }
272656
public function putValue($field, $value) {
		$this->validateValue($field, $value);
		$this->setValue($field, $value);
	}
209744
public function setNewValue(string $field, $value) : void
    {
        $change = $this->objectChangeSet->getFieldChange($field);

        if ($change !== null) {
            $change->setNewValue($value);
        } else {
            $this->objectChangeSet->addChange(new Change($field, null, $value));
        }
    }