Modifies data of single row by ID.
@access		public
@param		integer			$id				ID to focus on
@param		array			$data			Data to edit
@param		boolean			$stripTags		Flag: strip HTML Tags from values
@return		integer			Number of changed rows
193474
public function edit( $id, $data, $stripTags = TRUE ){
		$this->table->focusPrimary( $id );
		$result	= 0;
		if( count( $this->table->get( FALSE ) ) )
			$result	= $this->table->update( $data, $stripTags );
		$this->table->defocus();
		$this->cache->remove( $this->cacheKey.$id );
		return $result;
	}
1361598
public static function set($id, array $data)
    {
        self::init();
        //无id调用临时id
        $id = self::getID($id);
        if ($id === null) {
            self::setTmpID(); //临时id也不存则新写临时id
            $id = self::getID($id);
        }

        if (isset(self::$data[$id])) {
            self::$data[$id] = array_merge(self::$data[$id], $data); //合并多个场景数据
        } else {
            self::$data[$id] = $data;
        }
        self::$modified[$id] = 1; //标记该id的场景部分修改

        return true;
    }
1181553
public static function data(Tag $tag, $name, $data) {
    $js = sprintf("data(%s, %s)",
                  JSHelper::convertString($name), JSHelper::convertValue($data)
                  );
    
    $tag->chain(new Code($js));
    
    return $tag;
  }
786215
public function strip_php_tags($data)
    {
        if (is_array($data)) {
            foreach ($data as $key=>$value) {
                $data[$key] = $this->strip_php_tags($value);
            }
            return $data;
        }
        return addslashes(htmlspecialchars(strip_tags($data)));
    }
920044
public function update($id, $data)
    {
        $sections = empty($data['sections']) ? [] : $data['sections'];

        return $this->_sendPayload(
            $this->_getService($this->_pageServiceKey)->updateTemplateSections($id, $sections)
        );
    }
857275
public function update($id, array $data)
    {
        $istance = $this->getById($id);

        if (! $istance)
        {
            return false;
        }

        return $istance->update($data);
    }
1094339
public function updateRating($id, $data)
    {
        $rating = static::find($id);
        $rating->update($data);

        return $rating;
    }
1068338
public function write($id, $data)
    {
        $return = false;

        $data = array($this->_modifiedColumn => time(),
                      $this->_dataColumn     => (string) $data);

        $rows = call_user_func_array(array(&$this, 'find'), $this->_getPrimary($id));

        if (count($rows)) {
            $data[$this->_lifetimeColumn] = $this->_getLifetime($rows->current());

            if ($this->update($data, $this->_getPrimary($id, self::PRIMARY_TYPE_WHERECLAUSE))) {
                $return = true;
            }
        } else {
            $data[$this->_lifetimeColumn] = $this->_lifetime;

            if ($this->insert(array_merge($this->_getPrimary($id, self::PRIMARY_TYPE_ASSOC), $data))) {
                $return = true;
            }
        }

        return $return;
    }
408769
public function tagData(array $tags, $data, User $user = null, $replace = false)
    {
        $taggedObjects = [];
        $uniqueTags = [];

        foreach ($tags as $tag) {
            $value = trim($tag);

            if (!empty($value)) {
                $uniqueTags[strtolower($value)] = $value;
            }
        }
        $tagsList = [];

        foreach ($uniqueTags as $tagName) {
            $tagsList[$tagName] = $this->getOrCreateTag($tagName, $user);
        }

        foreach ($data as $objectData) {
            $objectId = $objectData['id'];
            $objectClass = $objectData['class'];
            $objectName = isset($objectData['name']) ? $objectData['name'] : null;

            if ($replace) {
                $this->removeUnusedTags($objectClass, $objectId, $tags);
            }

            foreach ($uniqueTags as $tagName) {
                $tag = $tagsList[$tagName];
                $taggedObject = null;

                if ($tag->getId()) {
                    $taggedObject = $this->getOneTaggedObjectByTagAndObject($tag, $objectId, $objectClass);
                }

                if (is_null($taggedObject)) {
                    $taggedObject = new TaggedObject();
                }

                $taggedObject->setTag($tag);
                $taggedObject->setObjectId($objectId);
                $taggedObject->setObjectClass($objectClass);
                $tag->addTaggedObject($taggedObject);

                if ($objectName) {
                    $taggedObject->setObjectName($objectName);
                }

                $this->om->persist($taggedObject);
                $taggedObjects[] = $taggedObject;
            }
        }

        $this->om->flush();

        return $taggedObjects;
    }
593528
public function update($id, array $data)
    {
        return $this->model->where($this->model->getKeyName(), $id)->update($data);
    }
139731
public function getById($id, $data = null)
    {
        $data = $this->includeEverything($data);
        return parent::getById($id, $data);
    }
1062935
public function updateCard(string $id, array $data, array $headers = [])
    {
        $url = $this->url('payment_sources/%s/update_card', $id);

        return $this->post($url, $data, $headers);
    }
898207
private function update($id, $data)
    {
        foreach ($data as $key => $value) {
            $fields[] = $key . ' = ?';
        }
        $query = 'UPDATE ' . self::DIAGNOSTIC_TABLE . ' SET ' . implode(', ', $fields) .
                 ' WHERE ' . self::DIAGNOSTIC_ID . ' = ?';
        return $this->persistence->exec($query, array_merge(array_values($data), array($id)));
    }
443504
public function edit($id = 0, $data = [])
	{
		$change = [];

		if (isset($data['email'])) {
			$change['email'] = $data['email'];
		}

		if (isset($data['role'])) {
			$change['role'] = $data['role'];
		}

		if (isset($data['username'])) {
			$change['username'] = Strings::webalize($data['username']);
		}

		if (isset($data['password']) && $data['password'] !== '') {
			$change['password'] = Passwords::hash($data['password']);
		}

		if (isset($data['name'])) {
			$change['name'] = $data['name'];
		}

		if ($this->useFiles && isset($data['avatar']) && $data['avatar'] && $data['avatar']->isOk()) {
			$change['avatar'] = $this->saveImage($data['avatar']);
		}

		$this->repository->update($id, $change);

		return $this->get($id);
	}
364147
public function update($id, array $data)
    {
        $model = $this->read($id)->fill($data);
        return $model->save();
    }
1139421
public function saveById($id, $data)
    {
        $exists = !is_null($id);
        if (!$exists) {
            $id = $this->findAvailableIdByData($data);
        }
        parent::saveById($id, $data);
        return $id;
    }
338545
public function save($id, $data)
    {
        $id = $this->uniqId + '-' + $id;
        if (!$this->apcIsEnabled()) {
            return false;
        }

        if (!$this->contains($id)) {
            if ($this->debug) {
                $this->cache->save($id, $data, 100);
            } else {
                $this->cache->save($id, $data);
            }

            return true;
        }

        return false;
    }