Пример #1
0
 /**
  * method instance.
  * 	- static, for singleton, for creating a global instance of this object
  *
  * @return - DBM Object
  */
 public static function run()
 {
     if (!isset(self::$instance)) {
         self::$instance = new DBM();
     }
     return self::$instance;
 }
 public static function getOption($name)
 {
     $dbm = DBM::instance();
     if (is_array($name)) {
         $que = "SELECT * FROM {options} WHERE name IN ('" . implode("','", $name) . "')";
     } else {
         $que = "SELECT * FROM {options} WHERE name = '" . $name . "'";
     }
     if (is_array($name)) {
         while ($row = $dbm->getFetchArray($que)) {
             $options[$row['name']] = self::fetchOption($row['vlaue']);
         }
         return $options;
     } else {
         $row = $dbm->getFetchArray($que);
         return self::fetchOption($row['value']);
     }
 }