Exemple #1
0
 public static final function fetchContacts($account_id)
 {
     $pairs[static::$contacts_table . '.contact_account_table'] = static::$accounts_table;
     $where = Db::prepWhere(array(static::$account_key => $account_id));
     return Db::_get()->fetchAll('SELECT * FROM `' . static::$contacts_table . '`' . array_shift($where), $where);
 }
Exemple #2
0
 public static final function deactivate($contact_id)
 {
     return Db::_get()->update(static::$accounts_table, 'contact_id', $contact_id, array('contact_is_active' => 0));
 }
Exemple #3
0
 public function stats()
 {
     $stats = 'Execution: ' . number_format(microtime(true) - START, 5);
     if (is_callable(array('Db', 'getQueryCount'))) {
         $stats .= ' | Queries: ' . Db::_get()->getQueryCount();
     }
     $stats .= ' | Memory: ' . number_format(memory_get_usage() / 1024 / 1024, 2) . 'MB';
     return $stats;
 }
Exemple #4
0
 public static function delete($staff_id)
 {
     return Db::_get()->run('DELETE FROM staff WHERE staff_id=?', array($staff_id));
 }
Exemple #5
0
 public static function tokenDestroy($token)
 {
     Db::_get()->update(static::$session_table, 'token', $token, array('is_active' => 0));
     return $token;
 }