删除当前对象
如果有 delete_time字段 默认是设置为当前时间

@param bool $force 是否强制
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);
    }
1323009
function delete($ids, $force=true)
    {
        if (!is_array($ids)) {
            // Not an array, break apart the encoded DNs.
            $ids = explode(',', $ids);
        } // end if

        foreach ($ids as $id) {
            $dn = self::dn_decode($id);

            // Need to delete all sub-entries first
            if ($this->sub_filter) {
                if ($entries = $this->ldap->list_entries($dn, $this->sub_filter)) {
                    foreach ($entries as $entry) {
                        if (!$this->ldap->delete_entry($entry['dn'])) {
                            $this->set_error(self::ERROR_SAVING, 'errorsaving');
                            return false;
                        }
                    }
                }
            }

            // Delete the record.
            if (!$this->ldap->delete_entry($dn)) {
                $this->set_error(self::ERROR_SAVING, 'errorsaving');
                return false;
            }

            // remove contact from all groups where he was a member
            if ($this->groups) {
                $dn = self::dn_encode($dn);
                $group_ids = $this->get_record_groups($dn);
                foreach (array_keys($group_ids) as $group_id) {
                    $this->remove_from_group($group_id, $dn);
                }
            }
        } // end foreach

        return count($ids);
    }
1063527
protected function checkFiles($force = false) {
        $files = $this->getFiles();
        foreach ($files as $file) {
            $this->checkFile($file, $force);
        }
    }
845692
public function toggle(string $class, ?bool $force = null): bool
    {
        if ($force === null) {
            $classes = $this->getClasses();

            if (in_array($class, $classes, true)) {
                $this->remove($class);

                return false;
            }

            $this->add($class);

            return true;
        }

        if ($force === true) {
            $this->add($class);

            return true;
        }

        $this->remove($class);

        return false;
    }
1139517
private function flushBuffer($force = false)
    {
        if ($this->_buffer === null) {
            return;
        }

        if ($force || StringHelper::byteLength($this->_buffer) == $this->chunkSize) {
            $this->insertChunk($this->_buffer);
            $this->_buffer = null;
        }
    }
974955
public function delete($name, $force = false)
    {
        $arg = ($force === true) ? '-D' : '-d';
        $this->clearAll();
        $this->addCommandName(self::BRANCH_COMMAND);
        $this->addCommandArgument($arg);
        $this->addCommandSubject($name);

        return $this->getCommand();
    }
876639
public function delete( $id, $force = false ) {

		$this->set_request_args( array(
			'method' => 'DELETE',
			'path'   => $id,
			'params' => array( 'force' => $force ),
		) );

		return $this->do_request();
	}
121931
public function getLowFF(bool $force = false): int
    {
        if ($force || $this->isOver32()) {
            return 0xFFFFFFFF;
        }
        return $this->getLow32();
    }
1279315
public function delete_upload($force = true)
    {
        // Bail early if not uploaded.
        if ($this->get_upload_path() === null) {
            return false;
        }

        if ($this->get_id() !== null) {
            $result = !\wp_delete_attachment($this->get_id(), $force) === false;
        } else {
            \wp_delete_file($this->get_upload_path());
            $result = !\file_exists($this->get_upload_path());
        }

        if ($result === true) {
            $this->attachment_id = null;
            $this->upload_path = null;
            $this->upload_error = null;
            $this->upload_type = null;
            $this->upload_url = null;
        }

        return $result;
    }
338974
private function fopen($force = false) {
            if ($force || !$this->fp) {
                $this->fclose();
                $this->fp = is_resource($this->config->savePath) ? $this->config->savePath
                    : fopen($this->config->savePath, 'ab');
            }

            return $this;
        }
691500
public function composerUpdate(bool $force = false): void
	{
		$this->maintenance();
		if ($force) {
			$this->composer->update();
		} else {
			$this->composer->authorizedUpdate();
		}
		$this->maintenance(false);
	}
360981
protected function _reindex($force = false)
    {
        $id = $this->getMimeId();

        if (($this->_status & self::STATUS_REINDEX) ||
            ($force && is_null($id))) {
            $this->buildMimeIds(
                is_null($id)
                    ? (($this->getPrimaryType() === 'multipart') ? '0' : '1')
                    : $id
            );
        }
    }
430411
public function delete(string $id, bool $force = false)
    {
        return $this->curl->delete($this->url.'/'.$id.'?'.http_build_query(['force' => $force]));
    }
1174075
public function getUpdates($force = FALSE) {
		if (!$force) {
			$result = $this->cache->get('updates');
			if ($result) {
				return $result;
			}
		}

		// Make sure we're logged in and have a valid access token.
		if (!$this->auth_token || !$this->username) {
			return FALSE;
		}

		$timestamp = parent::timestamp();
		$result = parent::post(
			'/all_updates',
			array(
				'timestamp' => $timestamp,
				'username' => $this->username,
			),
			array(
				$this->auth_token,
				$timestamp,
			)
		);

		if (!empty($result->updates_response)) {
			$this->auth_token = $result->updates_response->auth_token;
			$this->cache->set('updates', $result->updates_response);
			return $result->updates_response;
		}

		return $result;
	}
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.');
	}
1312431
public function deleteContainer($container, $force = false)
    {
        $this->checkConnection();
        try {
            /** @var Container $container */
            $container = $this->blobConn->getContainer($container);
            if (empty($container)) {
                throw new \Exception("No container named '$container'");
            }

            if (!$container->Delete()) {
                throw new \Exception('');
            }
        } catch (\Exception $ex) {
            static::handleGuzzleException($ex);
            throw new DfException("Failed to delete container '$container': " . $ex->getMessage());
        }
    }
156387
static function delete($directory, $force = false) {
        if (self::exists($directory)) {
            /**
             * Check for files
             *
             */
            $contents = scandir($directory);

            if ($force) {
                foreach ($contents as $content) {
                    if ($content != '.' && $content != '..') {
                        if (self::exists($directory . '/' . $content)) {
                            self::delete($directory . '/' . $content, true);
                        } else {
                            self::delete($directory . '/' . $content);
                        }
                    }
                }

                rmdir($directory);
            } else {
                $contents = scandir($directory);

                rmdir($directory);
            }

            if (!self::exists($directory)) return true;
        }

        return false;
    }