# betterdocs/2.3.5/admin/wp-notice/Utils/Base.php

BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ &amp; Chatbot, version 2.3.5. 44 lines.

- Page: https://pluginprobe.com/plugins/betterdocs/2.3.5/code/admin/wp-notice/Utils/Base.php
- Raw: https://pluginprobe.com/plugins/betterdocs/2.3.5/raw/admin/wp-notice/Utils/Base.php
- Modified: 2022-12-22T08:49:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/betterdocs/2.3.5/code/admin/wp-notice/Utils/Base.php#L10-L20`.

```php
<?php

namespace BetterDocs\WPNotice\Utils;

abstract class Base {
	/**
	 * Holds the plugin instance.
	 *
	 * @since 2.0.0
	 * @access protected
	 * @static
	 *
	 * @var Base
	 */
	private static $instances = [];

	/**
	 * Sets up a single instance of the plugin.
	 *
	 * @since 1.0.0
	 * @access public
	 * @static
	 *
	 * @return static An instance of the class.
	 */
	public static function get_instance( ...$args ) {
		$module = get_called_class();
		$module_id = $module;

		if( $module === 'BetterDocs\WPNotice\Notice' || $module === 'BetterDocs\WPNotice\Dismiss' ) {
			$module_id = $module . '::' . $args[0];
		}

		if ( ! isset( self::$instances[ $module_id ] ) ) {
			self::$instances[ $module_id ] = new $module( ...$args );
		}

		return self::$instances[ $module_id ];
	}

	protected function database( $args = null ){
		return new Storage( $args );
	}
}
```
