Reset some data status.

@param bool $force

@return $this
480805
public function reset($force = false)
    {
        $this->isBroadcast = false;
        $this->to = [];

        if ($force) {
            $this->sender = null;
            $this->userId = null;
        }

        return $this;
    }
112706
public function reset()
    {
        $this->_data     = array();
        $this->_modified = array();

        if ($this->isConnected()) {
            $this->_data = $this->getTable()->getDefaults();
        }

        return $this;
    }
348320
public function delete($force = false) {
        Event::trigger('record_before_delete', $this);
        $model = get_called_class();
        $pk = $this->getPkField();
        $id = $this->$pk;
        if (isset($id)) {
            $where[ $pk ] = $id;
            $delete_time = "delete_time";
            if (property_exists($model, $delete_time)) {
                if (!$force) {
                    $this->$delete_time = time();
                    $this->update();
                    return;
                }
            }
            DB::delete($this->getTable(), null)->where($pk, $id)->excuse();
        }
        //删除缓存
        /* @var $db_cache DBCache */
        $db_cache = Ioc::get(DBCache::class);
        $db_cache->recordWhereCacheDel($model, $this->cacheKeys(), $this->_db_data);
        $db_cache->recordCacheDel($model, $id);
    }
1055292
public function delete( $force = false ) {
		// If the object doesn't exist, there is nothing to delete
		// so we'll just return immediately and not do anything else.
		if ( ! $this->exists() ) {
			return;
		}

		// If the "prev_delete" filter returns false we'll bail out of the delete
		// and just return. Indicating that the delete failed.
		if ( false === apply_filters( $this->prefix( 'prev_delete' ), true ) ) {
			return;
		}

		/**
		 * Fires before a wp-object is deleted.
		 *
		 * @param static $wp_object Current object instance.
		 */
		do_action( $this->prefix( 'deleting' ), $this );

		$deleted = $this->perform_delete( $force );

		if ( $deleted ) {
			$this->clean_cache();

			// Now object will not exists.
			$this->exists = false;

			/**
			 * Fires after a WP_Object is deleted.
			 *
			 * @param int $object_id Object ID was deleted.
			 */
			do_action( $this->prefix( 'deleted' ), $this->get_id() );
		}

		return $deleted;
	}
770680
public function rewire($force=false): self
    {
        if(!$force && $this->rewired)
            return $this;

        Hooks::setup($this);

        $this->on("modified", [$this, "persist"]);
        $this->on("edge.created", [$this, "onEdgeCreated"]);
        $this->on("edge.connected", [$this, "onEdgeConnected"]);
        $this->on("deleting", [$this, "onDeleting"]);

        $this->rewired = true;
        return $this;
    }
303258
public function reset()
    {
        $this->getRepository()->getSpace()->setEntityState($this, AnDomain::STATE_CLEAN);
        $this->_modified = array();

        return $this;
    }
646169
public function get($force = false)
    {
        if (is_null($this->settings) || $force) {
            $_settings = $this->db->select()
                ->from($this->getTable())
                ->get();
            $settings = array();
            foreach ($_settings as $setting) {
                // decrypt the value if needed
                if (in_array($setting['setting_key'], $this->getEncrypted()) && ! empty($setting['setting_value'])) {
                    $settings[$setting['setting_key']] = $setting['setting_value'] = $this->getEncrypt()->decode($setting['setting_value']);
                }
                
                // unserialize the value
                if (in_array($setting['setting_key'], $this->getSerialized()) && ! empty($setting['setting_value'])) {
                    $settings[$setting['setting_key']] = $setting['setting_value'] = unserialize($setting['setting_value']);
                    foreach ($settings[$setting['setting_key']] as $key => $value) {
                        if ($value == '') {
                            unset($settings[$setting['setting_key']][$key]); // remove blank entries
                        }
                    }
                }
                
                // sort out new line values
                if (in_array($setting['setting_key'], $this->getNewLines())) {
                    $settings[$setting['setting_key']] = $setting['setting_value'] = explode("\n", $setting['setting_value']);
                    foreach ($settings[$setting['setting_key']] as $key => $value) {
                        $value = trim($value);
                        if ($value == '') {
                            unset($settings[$setting['setting_key']][$key]); // remove blank entries
                        } else {
                            $settings[$setting['setting_key']][$key] = $value;
                        }
                    }
                }
                
                $settings[$setting['setting_key']] = $setting['setting_value'];
            }
            
            $ignore = array(
                'license_check',
                'license_status'
            );
            foreach ($this->getDefaults() as $key => $value) {
                // setup the override check
                if (isset($this->overrides[$key]) && ! in_array($key, $ignore)) {
                    $settings[$key] = $this->overrides[$key];
                }
                
                if (! isset($settings[$key])) {
                    $settings[$key] = $value;
                }
            }
            
            $this->settings = $settings;
            
            if($this->settings['api_key'] == '')
            {
                $this->settings['api_key'] = $this->getEncrypt()->guid();
            }
            
            if($this->settings['api_secret'] == '')
            {
                $this->settings['api_secret'] = $this->getEncrypt()->guid();
            }            
        }
        
        return $this->settings;
    }
25239
public function delete($force = false)
    {
        $this->getParent()->channelDelete($this->getId(), $force);

        unset($this);
    }
1063527
protected function checkFiles($force = false) {
        $files = $this->getFiles();
        foreach ($files as $file) {
            $this->checkFile($file, $force);
        }
    }
780466
public function refresh($refresh = true)
    {
        $this->unitOfWorkHints[Query::HINT_REFRESH] = (boolean) $refresh;
        return $this;
    }
241343
public function execute(bool $force = false): void
	{
		if($force || $this->confirm('<yellow>Are you sure you want to reset your database?</yellow>'))
		{
			$this->nl();

			$this->rollback();

			return;
		}

		$this->nl();

		$this->write('Ok, no action was performed.');
	}
616883
public function rotate($force = true)
	{
		// do we have a session?
		if ( ! empty($this->keys))
		{
			// existing session. need to rotate the session id?
			if ($force or ($this->config['rotation_time'] and $this->keys['created'] + $this->config['rotation_time'] <= $this->time->get_timestamp()))
			{
				// generate a new session id, and update the create timestamp
				$this->keys['previous_id']	= $this->keys['session_id'];
				$this->keys['session_id']	= $this->_new_session_id();
				$this->keys['created'] 		= $this->time->get_timestamp();
				$this->keys['updated']		= $this->keys['created'];
			}
		}

		return $this;
	}
423286
public function refresh(bool $force = false, bool $cascade = false) : bool
    {
        $this->relinkDB();
        return $this->load();
    }
475889
protected function getHttpClient(bool $force = false): HttpClient
    {
        if ($this->_httpClient === null || $force) {
            $config = ArrayHelper::merge(['class' => HttpClient::class], $this->httpClientConfig);
            $config['baseUrl'] = $this->getBaseUrl();

            return $this->_httpClient = Yii::createObject($config);
        } else {
            return $this->_httpClient;
        }
    }
384627
public function read($force = false)
	{
		// initialize the session
		$this->data = array();
		$this->keys = array();
		$this->flash = array();
		$this->record = null;

		// get the session cookie
		$cookie = $this->_get_cookie();

		// if a cookie was present, find the session record
		if ($cookie and ! $force and isset($cookie[0]))
		{
			// read the session record
			$this->record = \DB::select()->where('session_id', '=', $cookie[0])->from($this->config['table'])->execute($this->config['database']);

			// record found?
			if ($this->record->count())
			{
				$payload = $this->_unserialize($this->record->get('payload'));
			}
			else
			{
				// try to find the session on previous id
				$this->record = \DB::select()->where('previous_id', '=', $cookie[0])->from($this->config['table'])->execute($this->config['database']);

				// record found?
				if ($this->record->count())
				{
					$payload = $this->_unserialize($this->record->get('payload'));
				}
				else
				{
					// cookie present, but session record missing. force creation of a new session
					logger('DEBUG', 'Error: Session cookie with ID "'.$cookie[0].'" present but corresponding record is missing');
					return $this->read(true);
				}
			}

			if ( ! isset($payload[0]) or ! is_array($payload[0]))
			{
				logger('DEBUG', 'Error: not a valid db session payload!');
			}
			elseif ($payload[0]['updated'] + $this->config['expiration_time'] <= $this->time->get_timestamp())
			{
				logger('DEBUG', 'Error: session id has expired!');
			}
			elseif ($this->config['match_ip'] and $payload[0]['ip_hash'] !== md5(\Input::ip().\Input::real_ip()))
			{
				logger('DEBUG', 'Error: IP address in the session doesn\'t match this requests source IP!');
			}
			elseif ($this->config['match_ua'] and $payload[0]['user_agent'] !== \Input::user_agent())
			{
				logger('DEBUG', 'Error: User agent in the session doesn\'t match the browsers user agent string!');
			}
			else
			{
				// session is valid, retrieve the payload
				if (isset($payload[0]) and is_array($payload[0])) $this->keys  = $payload[0];
				if (isset($payload[1]) and is_array($payload[1])) $this->data  = $payload[1];
				if (isset($payload[2]) and is_array($payload[2])) $this->flash = $payload[2];
			}
		}

		return parent::read();
	}
940043
protected function reset()
    {
        $this->status = null;
        $this->results = [];
        $this->currentDriver = null;
        $this->time['started_at'] = 0;
        $this->time['finished_at'] = 0;

        return $this;
    }
1257913
public function restore($force = true)
    {
        $ok = $this->handler->restore();

        if (!$ok && $force) {
            throw new Exception("Could not restore settings: No restore point available");
        }

        return $this;
    }