mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-16 04:22:37 +00:00
38 lines
705 B
PHP
38 lines
705 B
PHP
|
<?php
|
||
|
|
||
|
namespace Wikia\PortableInfobox\Helpers;
|
||
|
|
||
|
/**
|
||
|
* Class PortableInfoboxDataBag
|
||
|
* @package Wikia\PortableInfobox\Helpers
|
||
|
*/
|
||
|
class PortableInfoboxDataBag {
|
||
|
private static $instance = null;
|
||
|
private $galleries = [ ];
|
||
|
|
||
|
private function __construct() {
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return null|PortableInfoboxDataBag
|
||
|
*/
|
||
|
public static function getInstance() {
|
||
|
if ( is_null( self::$instance ) ) {
|
||
|
self::$instance = new self;
|
||
|
}
|
||
|
return self::$instance;
|
||
|
}
|
||
|
|
||
|
public function setGallery( $marker, $content ) {
|
||
|
$this->galleries[$marker] = $content;
|
||
|
}
|
||
|
|
||
|
public function getGallery( $marker ) {
|
||
|
if(isset($this->galleries[$marker])) {
|
||
|
return $this->galleries[$marker];
|
||
|
} else {
|
||
|
return null;
|
||
|
}
|
||
|
}
|
||
|
}
|