Updates the given note.

@param BankAccount $entity The phone object to update
@param string $data The entry with the new data

@return bool True if successful, otherwise false
760894
protected function updateBankAccount(BankAccount $entity, $data)
    {
        $success = true;

        if (isset($data['bic'])) {
            $entity->setBic($data['bic']);
        }
        $entity->setIban($data['iban']);
        $entity->setPublic($this->getBooleanValue((array_key_exists('public', $data) ? $data['public'] : false)));
        if (isset($data['bankName'])) {
            $entity->setBankName($data['bankName']);
        }

        return $success;
    }
678344
public function validate($data = null, $entity = null)
    {
        if (is_null($data)) {
            $data = $this->getData();
        }

        $this->data = $data;
        return !count(parent::validate($data, $entity));
    }
90976
protected function update($data)
    {
        try {

            if ($this->updateTouch) {
                $data[$this->updateTouchName] = date('Y-m-d H:i:s');
            }

            $this->db->update(
                $this->table,
                $this->fromArray($data),
                [
                    $this->primaryKey => $data[$this->primaryKey]
                ]
            );

            $id = $data[$this->primaryKey];

        } catch (\Exception $e) {
            throw $e;
        }

        return $id;
    }
635072
public function update(Record $record, Entity $entity)
    {
        (new UpdateRecord($record, $entity, $this))->execute();

        return $this;
    }
66072
public static function add(string $entity, array $data, bool $save = true)
    {
        return self::exeCreate($entity, $data, $save);
    }
342231
public function update(array $data)
    {
        if ( $this->validator->with($data)->validForUpdate() )
        {
            $data['permissions'] = explode(',', $data['permissions']);
            $this->permission->update($data);
            return true;
        }
        else
        {
            return false;
        }
    }
700607
public function save($entity) {
        $this->load();
        $mapper = MapperBuilder::buildFromClassName($this->mapping, get_class($entity));
        if (is_null($entity->getId())) {
            $affectedRows = $this->insertEntity($entity, $mapper);
        } else {
            $affectedRows = $this->updateEntity($entity, $mapper);
        }
        if (0 < $affectedRows) {
            return true;
        } else {
            return false;
        }
    }
1371171
private function updateActiveRow(Entity $entity) {
		$reflection = $entity->getColumns();
		$record = array();
		foreach ($reflection as $property) {
			$name = $property['name'];
			if ($entity->toRow()->$name != $entity->$name) {
				$record[$name] = $entity->$name;
			}
		}
		if (count($record) > 0) {
			$entity->toRow()->update($record);
		}
		$this->addLoop($entity);
	}
227306
protected static function exeCreate(string $entity, array $data, bool $save)
    {
        $dicionario = new Dicionario($entity);
        $dicionario->setData($data);

        if ($save)
            $dicionario->save();

        return self::return($dicionario);
    }
1197225
protected function updateEntity($data)
    {
        if (!$data instanceof DataInterface) {
            return;
        }
        $family = $data->getFamily();

        if (!array_key_exists($data->getFamilyCode(), $this->familyMap)) {
            return;
        }
        $resource = $data->get($this->familyMap[$data->getFamilyCode()]);
        if (!$resource instanceof Document) {
            // Maybe we should reset the values to null
            return;
        }
        $data->setFileSize($resource->getFileSize());
        $this->valuesToPersist[] = $data->getValue($family->getAttribute('fileSize'));

        $data->setMimeType($resource->getMimeType());
        $this->valuesToPersist[] = $data->getValue($family->getAttribute('mimeType'));

        $data->setFileName($resource->getOriginalFileName());
        $this->valuesToPersist[] = $data->getValue($family->getAttribute('fileName'));
    }
586999
public function update(array $data, $ApportionmentEntry = null, $databaseConnectionName = null)
  {
    if(empty($ApportionmentEntry))
    {
      $ApportionmentEntry = $this->byId($data['id'], $databaseConnectionName);
    }

    foreach ($data as $key => $value)
    {
      $ApportionmentEntry->$key = $value;
    }

    return $ApportionmentEntry->save();
  }
378023
public function update($data, $entity = null)
	{
		if(is_null($entity) && array_key_exists('uuid', $data))
		{
			// Pull the uuid value out and set it as the entity.
			$entity = key($data['uuid']);

			// Remove the outer array layer.
			$data = $data['uuid'][key($data['uuid'])];
		}

		// Update the outer most entity.
		$updatePayload = $this->updateByType($data, $entity);

		if($updatePayload->getStatus() != 'updated')
		{
			$updatePayload;
		}

		// Update referenced entities.
		if(array_key_exists('ref', $data))
		{
			// Init
			$referenceUpdatePayload = [];

			// Currently only way layer deep, @todo: add recursion @todo: requires uuids or entity only.
			foreach($data['ref'] as $referenceUuid => $referenceData)
			{
				// Update referenced entities. @todo: Embedded updates failures will go silently.
				$referenceUpdatePayload[] = $this->updateByType($referenceData, $referenceUuid);
			}
		}

		// @todo: The following currently adds an additional query just for the ease of getting the full entity to return.
		$updatedEntityPayload = $this->getOneByUuid($updatePayload->getData()->getUuid());

		if($updatedEntityPayload->getStatus() !== 'found')
		{
			return $updatedEntityPayload;
		}

		return new Payload($updatedEntityPayload->getData(), $updatePayload->getStatus());
	}
472446
public function update($data = null)
    {
        if ($this->hasMethod('__update') && is_callable([$this, '__update'])) {
            return $this->__update($data);
        }

        // notify observers about new data
        $this->notify();
    }
909285
public function updateFromEmbeddedApiResponse(array $data, string $currency, PaymentMethodInterface $paymentMethod = null): PaymentMethodInterface
    {
        if (!$paymentMethod) {
            $paymentMethod = $this->getPaymentMethod($data['id']);
        }

        if (!$paymentMethod->getId()) {
            // only update when we create a new entity because this is the embedded method
            $paymentMethod
                ->setFee(DandomainFoundation\createMoney((string) $currency, $data['fee']))
                ->setFeeInclVat($data['feeInclVat'])
                ->setName($data['name']);
        }

        return $paymentMethod;
    }
1074759
public function save($entity)
    {
        if ($this->idProperty->getValue($entity) === null) {
            return $this->insert($entity);
        } else {
            return $this->update($entity);
        }

    }
476661
public function update(Request $request, $entity, $id, $child = null, $record = null)
    {
        if (!$record && !$child && ($entityObject = Entity::fromYamlFile($entity))) {
            // Get the record from the database, or fail if it is not found
            $entityClass = $entityObject->class;
            $recordObject = $entityClass::findOrFail($id);
        } elseif (($parentEntity = Entity::fromYamlFile($entity)) && ($entityObject = Entity::fromYamlFile($child))) {
            // Get parent's record
            $parentRecord = $parentEntity->class::findOrFail($id);

            // Get the record from the database, or fail if it is not found
            $entityClass = $entityObject->class;
            $recordObject = $entityClass::findOrFail($record);
        } else {
            abort(404);
        }

        // Get validation from entity rules and validate
        $this->validate($request, $this->validationRules($entityObject->fields, true));

        // If data is validated and everything seems good, lets update the record
        foreach ($entityObject->fields as $field => $options) {
            $type = ucwords($options['type']);
            $className = 'Jaimeeee\\Panel\\Fields\\'.$type.'\\'.$type.'Field';

            if (!isset($className::$ignore) || !$className::$ignore) {
                $recordObject->$field = $request->input($field);
            }

            // Lets see if the call method exists, and if it does, we should trust the field ¯\_(ツ)_/¯
            if (method_exists($className, 'call')) {
                $className::call($request, $recordObject, $field, $options);
            }
        }

        // Edit slug
        if (isset($entityObject->slug['field']) && $entityObject->slug['field'] &&
            isset($entityObject->slug['column']) && $entityObject->slug['column']) {
            $field = $entityObject->slug['field'];
            $column = $entityObject->slug['column'];

            $recordObject->$column = str_slug($recordObject->$field,
                                            isset($entityObject->slug['separator']) ? $entityObject->slug['separator'] : '-');
        }

        $recordObject->save();

        // Upload single images
        // $this->uploadImages($request, $recordObject, $entityObject);

        if (isset($parentRecord) && $parentRecord) {
            return redirect(config('panel.url').'/'.$parentEntity->url.'/'.$parentRecord->id.'/'.$entityObject->url.'?updated=1');
        } else {
            return redirect(config('panel.url').'/'.$entityObject->url.'?updated=1');
        }
    }
205094
protected function doUpdateBatch($data, array $conditions)
    {
        !$this->useTransaction ?: $this->db->getTransaction(true)->start();

        try {
            $result = $this->db->getWriter()->updateBatch($this->table, $data, $conditions);
        } catch (\Throwable $e) {
            !$this->useTransaction ?: $this->db->getTransaction(true)->rollback();

            throw $e;
        }

        !$this->useTransaction ?: $this->db->getTransaction(true)->commit();

        return $result;
    }