Store changes to this database entry

@param   boolean  $check  Perform data validation check?
@return  boolean  False if error, True on success
337540
public function store($check=true)
	{
		// Validate data?
		if ($check)
		{
			// Is data valid?
			if (!$this->check())
			{
				return false;
			}

			if ($this->_context)
			{
				$results = \Event::trigger('content.onContentBeforeSave', array(
					$this->_context,
					&$this,
					$this->exists()
				));
				foreach ($results as $result)
				{
					if ($result === false)
					{
						$this->setError(\App::get('language')->txt('Content failed validation.'));
						return false;
					}
				}
			}
		}

		// Attempt to store data
		if (!$this->_tbl->store())
		{
			$this->setError($this->_tbl->getError());
			return false;
		}

		return true;
	}
1006714
function store( $storeAsValid = false )
    {
        $dateTime = time();
        $user = eZUser::currentUser();
        if (  $this->ID == null )
        {
            parent::store();
            return;
        }

        $db = eZDB::instance();
        $db->begin();
        if ( $storeAsValid )
        {
            $oldStatus = $this->attribute( 'status' );
            $this->setAttribute( 'status', eZRSSExport::STATUS_VALID );
        }
        $this->setAttribute( 'modified', $dateTime );
        $this->setAttribute( 'modifier_id', $user->attribute( "contentobject_id" ) );
        parent::store();
        $db->commit();
        if ( $storeAsValid )
        {
            $this->setAttribute( 'status', $oldStatus );
        }
    }
777218
public function setChecked(bool $checked)
    {
        if ($checked) {
            $this->getTag()->setAttribute('checked', 'checked');
        } else {
            $this->getTag()->removeAttribute('checked');
        }

        return $this;
    }
1109462
public function clear($check)
    {
        $this->_auth();
        $max = xcache_count(XC_TYPE_VAR);
        for ($i = 0; $i < $max; $i++) {
            xcache_clear_cache(XC_TYPE_VAR, $i);
        }
        $this->_auth(true);

        return true;
    }
941958
protected function onInvalidEventAttributeValidate($key, $check = [], $rule = NULL)
    {
        $this->validate[] = $rule ?: $key;

        return $this->required()->onInvalidEventCustomValidity($key, $check);
    }
806275
public function commit($delete = true)
    {
        $diff = $this->getDiff();

        if ($delete) {
            foreach ($diff['unknown'] as $index) {
                $this->deleteIndex($index['name']);
            }
        }

        foreach ($diff['missing'] as $name => $index) {
            $this->ensureIndex($index['keys'], $index['options']);
        }

        return true;
    }
580859
protected function check(string $name, string $check = ''): bool
    {
        return Arr::get($this->keyMap, "{$name}.checksum") === $this->generateNewChecksum($check);
    }
29795
public function setChecked($checked = true)
    {
        $this->clearCache();
        $this->checked = (bool)$checked;
        return $this;
    }
928984
private function hasValue(array $check, string $value): bool
    {
        if (empty($check[$value])) {
            return false;
        }

        return true;
    }
60014
public function clear($check)
    {
        if (!$this->_init) {
            return false;
        }
        $this->_File = null;

        $threshold = $now = false;
        if ($check) {
            $now = time();
            $threshold = $now - $this->_config['duration'];
        }

        $this->_clearDirectory($this->_config['path'], $now, $threshold);

        $directory = new RecursiveDirectoryIterator(
            $this->_config['path'],
            \FilesystemIterator::SKIP_DOTS
        );
        $contents = new RecursiveIteratorIterator(
            $directory,
            RecursiveIteratorIterator::SELF_FIRST
        );
        $cleared = [];
        foreach ($contents as $path) {
            if ($path->isFile()) {
                continue;
            }

            $path = $path->getRealPath() . DIRECTORY_SEPARATOR;
            if (!in_array($path, $cleared)) {
                $this->_clearDirectory($path, $now, $threshold);
                $cleared[] = $path;
            }
        }

        return true;
    }
319164
function save()
    {
        if ($this->id != false || $this->id != 0) {
            return $this->update();
        } else {
            return $this->insert();
        }
    }
20882
function save()
    {
        $this->_save = false;
        if ($this->_change == 0 or $this->_change == 1)
        {
            if ($this->db->insert($this->_data, $this->table) === false)
            {
                return false;
            }
            //改变状态
            $this->_change = 1;
            $this->_current_id = $this->db->lastInsertId();
        }
        elseif ($this->_change == 2)
        {
            $update = $this->_update;
            unset($update[$this->primary]);
            if ($this->db->update($this->_current_id, $update, $this->table, $this->primary) === false)
            {
                return false;
            }
        }
        $this->notify();
        return true;
    }
972773
public function checkIntegrity($check)
  {
    $db=$this->getDbConnection();
    foreach($this->schemas as $schema){
      $db->createCommand()->checkIntegrity($check,$schema)->execute();
    }
  }
654443
public function save(): bool
	{
		$success = true;

		if(!$this->isPersisted)
		{
			// This is a new record so we need to insert it into the database.

			$this->insertRecord($this->builder());

			$this->isPersisted = true;
		}
		elseif($this->isModified())
		{
			// This record exists and is modified so all we have to do is update it.

			$success = $this->updateRecord($this->builder());
		}

		if($success)
		{
			// Sync up if save was successful

			$this->synchronize();
		}

		return $success;
	}
1152693
public function delete($code, $check = true)
    {
        $result = null;
        $this->hook->attach('currency.delete.before', $code, $check, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        if ($check && !$this->canDelete($code)) {
            return false;
        }

        $currencies = $this->config->select('currencies', array());
        unset($currencies[$code]);

        $result = $this->config->set('currencies', $currencies);

        $this->hook->attach('currency.delete.after', $code, $check, $result, $this);
        return (bool) $result;
    }
582981
public function setChecked(array $checked)
    {
        foreach ($this->checkboxes as $checkbox) {
            /* @var $checkbox Checkbox */
            $checkbox->setChecked(in_array($checkbox->getName(), $checked));
        }

        return $this;
    }
238663
public function store($input)
    {
        $this->model = $this->model->fill($input);

        $filteredInput = $this->runChecks('store', $this->model->toArray());

        if ($filteredInput) {
            $this->model->fill($filteredInput);
        }

        return $this->model->save();
    }