File "storage-registry.php"

Full Path: /home/siazco/grocery.siazco.se/wp-content/plugins/kapee-extensions/inc/admin/meta-box/inc/storage-registry.php
File size: 418 bytes
MIME-type: text/x-php
Charset: utf-8

<?php
/**
 * Storage registry class
 */
class RWMB_Storage_Registry {
	protected $storages = [];

	/**
	 * Get storage instance.
	 *
	 * @param string $class_name Storage class name.
	 * @return RWMB_Storage_Interface
	 */
	public function get( $class_name ) {
		if ( empty( $this->storages[ $class_name ] ) ) {
			$this->storages[ $class_name ] = new $class_name();
		}

		return $this->storages[ $class_name ];
	}
}