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); }
public static final function deactivate($contact_id) { return Db::_get()->update(static::$accounts_table, 'contact_id', $contact_id, array('contact_is_active' => 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; }
public static function delete($staff_id) { return Db::_get()->run('DELETE FROM staff WHERE staff_id=?', array($staff_id)); }
public static function tokenDestroy($token) { Db::_get()->update(static::$session_table, 'token', $token, array('is_active' => 0)); return $token; }