/** * Create current class object (create once). * * @return Phpdays */ public static function singleton() { // create itself only once if (is_null(self::$_oInstatce)) { $sClassName = __CLASS__; self::$_oInstatce = new $sClassName(); } // return link to itself object return self::$_oInstatce; }