MysqliDb::getInstance PHP Method

getInstance() public static method

Inheriting this class would require reloading connection info.
public static getInstance ( ) : MysqliDb
return MysqliDb Returns the current instance.
    public static function getInstance()
    {
        return self::$_instance;
    }

Usage Example

コード例 #1
1
 public function SetProperties($lang, $id, $name, $description)
 {
     if ($who = Registry::getInstance()->getUser()) {
         if (isset($who['user_id']) && $who['user_id']) {
             $this_prop = $this->ListProperties(array($lang), array(), array($id));
             $db = MysqliDb::getInstance();
             if ($this_prop) {
                 $data = array($this->_propertyType => $name, 'description' => $description, 'who_last_update' => $who['user_id']);
                 if ($db->where($this->_propertyType . '_id', $id)->where('language', $lang)->update($this->_propertyType . '_data', $data)) {
                     return $name;
                 } else {
                     return false;
                 }
             } else {
                 $data = array($this->_propertyType . '_id' => $id, 'language' => $lang, $this->_propertyType => $name, 'description' => $description, 'who_last_update' => $who['user_id']);
                 if ($db->insert($this->_propertyType . '_data', $data)) {
                     return true;
                 } else {
                     return false;
                 }
             }
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
All Usage Examples Of MysqliDb::getInstance