mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-12-01 03:16:53 +00:00
41 lines
766 B
PHP
41 lines
766 B
PHP
<?php
|
|
|
|
namespace PortableInfobox\Helpers;
|
|
|
|
/**
|
|
* Class PortableInfoboxDataBag
|
|
* @package PortableInfobox\Helpers
|
|
*/
|
|
class PortableInfoboxDataBag {
|
|
private static $instance = null;
|
|
private $galleries = [];
|
|
|
|
private function __construct() {
|
|
}
|
|
|
|
/**
|
|
* @return null|PortableInfoboxDataBag
|
|
*/
|
|
public static function getInstance() {
|
|
if ( self::$instance === null ) {
|
|
self::$instance = new self;
|
|
}
|
|
return self::$instance;
|
|
}
|
|
|
|
public function setGallery( $marker, $content ) {
|
|
$this->galleries[$marker] = $content;
|
|
}
|
|
|
|
/**
|
|
* Retrieve source content of a gallery identified by Parser marker id
|
|
*/
|
|
public function getGallery( $marker ) {
|
|
if ( isset( $this->galleries[$marker] ) ) {
|
|
return $this->galleries[$marker];
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|