Deletes previously generated network.

@since 1.0.0

@access protected
@global \wpdb $wpdb The database connection.
@param int $network_id The network id.
@return boolean TRUE on success, otherwise FALSE.
489314
protected function _deleteObject( $network_id ) {
		global $wpdb;

		$network_blog = wp_get_sites( array( 'network_id' => $network_id ) );
		if ( ! empty( $network_blog ) ) {
			$suppress = $wpdb->suppress_errors();

			foreach ( $network_blog as $blog ) {
				wpmu_delete_blog( $blog->blog_id, true );
			}

			$wpdb->suppress_errors( $suppress );
		}

		$deleted = $wpdb->delete( $wpdb->site, array( 'id' => $network_id ), array( '%d' ) );
		if ( $deleted ) {
			$wpdb->delete( $wpdb->sitemeta, array( 'site_id' => $network_id ), array( '%d' ) );
			$this->_debug( 'Deleted network with ID: ' . $network_id );

			return true;
		}

		$this->_debug( 'Failed to delet network with ID: ' . $network_id );

		return false;
	}
888958
private function delete_expired( $network ) {
		global $wpdb;

		$count = 0;

		if ( ! $network ) {
			$count += $wpdb->query(
				$wpdb->prepare(
					"DELETE a, b FROM {$wpdb->options} a, {$wpdb->options} b
						WHERE a.option_name LIKE %s
						AND a.option_name NOT LIKE %s
						AND b.option_name = CONCAT( '_transient_timeout_', SUBSTRING( a.option_name, 12 ) )
						AND b.option_value < %d",
					Utils\esc_like( '_transient_' ) . '%',
					Utils\esc_like( '_transient_timeout_' ) . '%',
					time()
				)
			);
		} else {
			if ( ! is_multisite() ) {
				// Non-Multisite stores site transients in the options table.
				$count += $wpdb->query(
					$wpdb->prepare(
						"DELETE a, b FROM {$wpdb->options} a, {$wpdb->options} b
							WHERE a.option_name LIKE %s
							AND a.option_name NOT LIKE %s
							AND b.option_name = CONCAT( '_site_transient_timeout_', SUBSTRING( a.option_name, 17 ) )
							AND b.option_value < %d",
						Utils\esc_like( '_site_transient_' ) . '%',
						Utils\esc_like( '_site_transient_timeout_' ) . '%',
						time()
					)
				);
			} else {
				// Multisite stores site transients in the sitemeta table.
				$count += $wpdb->query(
					$wpdb->prepare(
						"DELETE a, b FROM {$wpdb->sitemeta} a, {$wpdb->sitemeta} b
							WHERE a.meta_key LIKE %s
							AND a.meta_key NOT LIKE %s
							AND b.meta_key = CONCAT( '_site_transient_timeout_', SUBSTRING( a.meta_key, 17 ) )
							AND b.meta_value < %d",
						Utils\esc_like( '_site_transient_' ) . '%',
						Utils\esc_like( '_site_transient_timeout_' ) . '%',
						time()
					)
				);
			}
		}

		// The above queries delete the transient and the transient timeout
		// thus each transient is counted twice.
		$count = $count / 2;

		if ( $count > 0 ) {
			WP_CLI::success(
				sprintf(
					'%d expired %s deleted from the database.',
					$count,
					Utils\pluralize( 'transient', $count )
				)
			);
		} else {
			WP_CLI::success( 'No expired transients found.' );
		}

		if ( wp_using_ext_object_cache() ) {
			WP_CLI::warning( 'Transients are stored in an external object cache, and this command only deletes those stored in the database. You must flush the cache to delete all transients.' );
		}
	}
1268245
def deleteNetwork(self, id, headers=None, query_params=None, content_type="application/json"):
        
        uri = self.client.base_url + "/network/"+id
        return self.client.delete(uri, None, headers, query_params, content_type)
1002352
private function delete_all( $network ) {
		global $wpdb;

		// To ensure proper count values we first delete all transients with a timeout
		// and then the remaining transients without a timeout.
		$count = 0;

		if ( ! $network ) {
			$deleted = $wpdb->query(
				$wpdb->prepare(
					"DELETE a, b FROM {$wpdb->options} a, {$wpdb->options} b
						WHERE a.option_name LIKE %s
						AND a.option_name NOT LIKE %s
						AND b.option_name = CONCAT( '_transient_timeout_', SUBSTRING( a.option_name, 12 ) )",
					Utils\esc_like( '_transient_' ) . '%',
					Utils\esc_like( '_transient_timeout_' ) . '%'
				)
			);

			$count += $deleted / 2; // Ignore affected rows for timeouts.

			$count += $wpdb->query(
				$wpdb->prepare(
					"DELETE FROM $wpdb->options WHERE option_name LIKE %s",
					Utils\esc_like( '_transient_' ) . '%'
				)
			);
		} else {
			if ( ! is_multisite() ) {
				// Non-Multisite stores site transients in the options table.
				$deleted = $wpdb->query(
					$wpdb->prepare(
						"DELETE a, b FROM {$wpdb->options} a, {$wpdb->options} b
							WHERE a.option_name LIKE %s
							AND a.option_name NOT LIKE %s
							AND b.option_name = CONCAT( '_site_transient_timeout_', SUBSTRING( a.option_name, 17 ) )",
						Utils\esc_like( '_site_transient_' ) . '%',
						Utils\esc_like( '_site_transient_timeout_' ) . '%'
					)
				);

				$count += $deleted / 2; // Ignore affected rows for timeouts.

				$count += $wpdb->query(
					$wpdb->prepare(
						"DELETE FROM $wpdb->options WHERE option_name LIKE %s",
						Utils\esc_like( '_site_transient_' ) . '%'
					)
				);
			} else {
				// Multisite stores site transients in the sitemeta table.
				$deleted = $wpdb->query(
					$wpdb->prepare(
						"DELETE a, b FROM {$wpdb->sitemeta} a, {$wpdb->sitemeta} b
							WHERE a.meta_key LIKE %s
							AND a.meta_key NOT LIKE %s
							AND b.meta_key = CONCAT( '_site_transient_timeout_', SUBSTRING( a.meta_key, 17 ) )",
						Utils\esc_like( '_site_transient_' ) . '%',
						Utils\esc_like( '_site_transient_timeout_' ) . '%'
					)
				);

				$count += $deleted / 2; // Ignore affected rows for timeouts.

				$count += $wpdb->query(
					$wpdb->prepare(
						"DELETE FROM $wpdb->sitemeta WHERE meta_key LIKE %s",
						Utils\esc_like( '_site_transient_' ) . '%'
					)
				);
			}
		}

		if ( $count > 0 ) {
			WP_CLI::success(
				sprintf(
					'%d %s deleted from the database.',
					$count,
					Utils\pluralize( 'transient', $count )
				)
			);
		} else {
			WP_CLI::success( 'No transients found.' );
		}

		if ( wp_using_ext_object_cache() ) {
			WP_CLI::warning( 'Transients are stored in an external object cache, and this command only deletes those stored in the database. You must flush the cache to delete all transients.' );
		}
	}
956383
public function delete( $args, $assoc_args ) {
		list( $id ) = $args;

		$assoc_args = wp_parse_args( $assoc_args, array(
			'delete_blogs' => false,
		) );

		$network_id = delete_network( $id, $assoc_args['delete_blogs'] );

		if ( is_wp_error( $network_id ) ) {
			WP_CLI::error( $network_id );
		}

		WP_CLI::success( sprintf( 'Deleted network %d.', $id ) );
	}
500048
public static function deleteXDomainUserId($id)
	{
		$db = \App::get('db');

		if (empty($id))
		{
			return false;
		}

		$id = intval($id);

		if ($id <= 0)
		{
			return false;
		}

		$query = 'DELETE FROM `#__xdomain_users` WHERE uidNumber=' . $db->quote($id) . ';';

		$db->setQuery($query);

		$db->query();

		return true;
	}
1335197
protected static function destroyAddress($address, $connection_id)
    {
        $gateway_data                  = GatewayProtocol::$empty;
        $gateway_data['cmd']           = GatewayProtocol::CMD_DESTROY;
        $gateway_data['connection_id'] = $connection_id;
        return self::sendToGateway($address, $gateway_data);
    }
765642
def delete_dcnm_in_nwk(self, tenant_id, fw_dict, is_fw_virt=False):
        
        tenant_name = fw_dict.get('tenant_name')
        ret = self._delete_service_nwk(tenant_id, tenant_name, 'in')
        if ret:
            res = fw_const.DCNM_IN_NETWORK_DEL_SUCCESS
            LOG.info("In Service network deleted for tenant %s",
                     tenant_id)
        else:
            res = fw_const.DCNM_IN_NETWORK_DEL_FAIL
            LOG.info("In Service network deleted failed for tenant %s",
                     tenant_id)
        self.update_fw_db_result(tenant_id, dcnm_status=res)
        return ret
678531
public function delete($id)
    {
        $data = $this->findById($id);

        $this->client
            ->DebtorContact_Delete(array(
                "debtorContactHandle" => $data->Handle
            ));

        return true;
    }
360359
public function delete_wlan($wlan_id)
    {
        if (!$this->is_loggedin) {
            return false;
        }

        $this->request_type = 'DELETE';
        $response           = $this->exec_curl('/api/s/' . $this->site . '/rest/wlanconf/' . trim($wlan_id));

        return $this->process_response_boolean($response);
    }
397248
function deleteCacheByBookId( $book_id ) {

		/** @var $wpdb \wpdb */
		global $wpdb;

		$sql = "SELECT users_id FROM {$this->dbTable} WHERE blogs_id = %d ";
		$results = $wpdb->get_col( $wpdb->prepare( $sql, $book_id ) ); // @codingStandardsIgnoreLine

		foreach ( $results as $user_id ) {
			wp_cache_delete( "cat-$user_id", 'pb' );
		}
	}
106626
private function page_delete_network() {
		$network_id = filter_input( INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT );
		$network    = $network_id ? get_network( $network_id ) : null;

		// Bail if invalid network ID.
		if ( empty( $network ) ) {
			wp_die( esc_html__( 'Invalid network id.', 'wp-multi-network' ) );
		}

		$sites = get_sites( array( 'network_id' => $network->id ) );

		$add_network_url = $this->admin_url( array( 'page' => 'add-new-network' ) );
		?>

		<div class="wrap">
			<h1>
				<?php
				esc_html_e( 'Delete Network', 'wp-multi-network' );

				if ( current_user_can( 'create_networks' ) ) {
					?>
					<a href="<?php echo esc_url( $add_network_url ); ?>" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'network', 'wp-multi-network' ); ?></a>
					<?php
				}
				?>
			</h1>

			<form method="post" action="<?php echo esc_attr( remove_query_arg( 'action' ) ); ?>">
				<?php

				if ( ! empty( $sites ) ) {
					?>

					<div id="message" class="network-delete">
						<p><?php esc_html_e( 'The following sites are associated with this network:', 'wp-multi-network' ); ?></p>
						<ul class="delete-sites">
							<?php

							foreach ( $sites as $site ) {
								?>
								<li><?php echo esc_html( $site->domain . $site->path ); ?></li>
								<?php
							}

							?>
						</ul>
						<p>
							<input type="checkbox" name="override" id="override">
							<label for="override">
							<?php
							if ( wp_should_rescue_orphaned_sites() ) {
								esc_html_e( 'Rescue these sites', 'wp-multi-network' );
							} else {
								esc_html_e( 'Delete these sites', 'wp-multi-network' );
							}
							?>
							</label>
						</p>
					</div>
					<p>
						<?php
						printf(
							/* translators: %s: network domain and path */
							esc_html__( 'Are you sure you want to delete the entire "%s" network?', 'wp-multi-network' ),
							esc_html( $network->domain . $network->path )
						);
						?>
					</p>

					<?php
				}

				wp_nonce_field( 'edit_network', 'network_edit' );

				submit_button( esc_html__( 'Delete Network', 'wp-multi-network' ), 'primary', 'delete', false );
				?>

				<a class="button" href="<?php echo esc_url( $this->admin_url() ); ?>"><?php esc_html_e( 'Cancel', 'wp-multi-network' ); ?></a>
			</form>
		</div>

		<?php
	}
838970
function destroy($session_id)
    {

        // deletes the current session id from the database
        $result = $this->_mysql_query('

            DELETE FROM
                ' . $this->table_name . '
            WHERE
                session_id = "' . $this->_mysql_real_escape_string($session_id) . '"

        ') or die($this->_mysql_error());

        // if anything happened
        // return true
        if ($this->_mysql_affected_rows() !== -1) return true;

        // if something went wrong, return false
        return false;

    }
1211110
public function destroy($session_id)
	{
		// Get the database connection object and verify its connected.
		if (!$this->connection->connected())
		{
			return false;
		}

		try
		{
			$query = $this->connection->getQuery()
				->delete('#__session')
				->whereEquals('session_id', $session_id);

			// Remove a session from the database.
			$this->connection->setQuery($query->toString());

			return (boolean) $this->connection->execute();
		}
		catch (Exception $e)
		{
			return false;
		}
	}
409200
public function destroy($id)
    {
        $this->newQuery();

        $queryKey = $this->queryBuilder->whereEqual($this->primaryFieldName, $id)->firstQueryKey();

        if (!$this->isCompleteKey($queryKey)) {
            return false;
        }

        return (bool)$this->redClient->del([$queryKey]);
    }
1265219
function delete( $for_real = false ) {

		/** @var $wpdb \wpdb */
		global $wpdb;

		if ( $for_real ) {
			return $wpdb->delete(
				$this->dbTable, [
					'users_id' => $this->userId,
				], [ '%d' ]
			);
		} else {
			return $wpdb->update(
				$this->dbTable, [
					'deleted' => 1,
				], [
					'users_id' => $this->userId,
				], [ '%d' ], [ '%d' ]
			);
		}
	}
948146
public function delete_data( $post_id ) {
		$table = $this->get_related_table_name();
		$this->delete_misc( $post_id );

		return $this->app->db->delete( $table, [
			'post_id' => $post_id,
		] );
	}