Пример #1
0
 /**
  * TuiyoTableTimelinetmpl::getInstance()
  * 
  * @param mixed $db
  * @param bool $ifNotExist
  * @return
  */
 public function getInstance($db = null, $ifNotExist = true)
 {
     /** Creates new instance if none already exists ***/
     static $instance = array();
     if (isset($instance) && !empty($instance) && $ifNotExist) {
         if (is_object($instance)) {
             return $instance;
         } else {
             unset($instance);
             TuiyoTableTimelinetmpl::getInstance($db, $ifNotExist);
         }
     } else {
         $instance = new TuiyoTableTimelinetmpl($db);
     }
     return $instance;
 }