Source of file Creator.php
Size: 0,577 Bytes - Last Modified: 2020-07-03T12:08:09+00:00
/var/www/docs.ssmods.com/process/src/src/Traits/Creator.php
12345678910111213141516171819202122232425262728293031 | <?php namespace Sunnysideup\UpgradeToSilverstripe4\Traits; trait Creator { /** * Holds the only instance of me * @var mixed */ protected static $singleton = null; public function destroy() { self::$singleton = null; } /** * Create the only instance of me and return it * @return mixed */ public static function create() { if (self::$singleton === null) { $className = static::class; self::$singleton = new $className(); } return self::$singleton; } } |