ea-Geiercode-base
[ class tree: ea-Geier ] [ index: ea-Geier ] [ all elements ]

Class: eaDB

Source Location: /code/base/db.class.php

Class eaDB

Property Summary
array   $conf   configuration data
array   $user   user data
string   $_clientTables   client tables
object   $_db   database resource
string   $_prefix   table prefix

[ Top ]
Method Summary
eaDB   eaDB()   constructor of database wrapper
boolean   addUserToClient()   add user to client
array   checkLogin()   login validation
boolean   createClient()   create client
boolean   createUser()   create user
string   decrypt()   decrypt string
boolean   delete()   delete datasets
boolean   deleteClient()   delete client
boolean   deleteUser()   delete user
boolean   delUserClient()   remove user from client
boolean   drop()   drop table
string   encrypt()   encrypt string
boolean   error()   checks for database error
string   escape()   escape value string
string   escapeKey()   escape key string
array   getClientConf()   get client configuration variables
boolean   getClients()   get assigned clients
array   getClientUsers()   get client users
array   getSysConf()   get system configuration variables
array   getUserConf()   get user configuration variables
boolean   insert()   insert array into table
boolean   isOwner()   checks if user is owner
boolean/string   isUser()   checks if user exists
integer   lastID()   get last inserted id
integer   loadClientConf()   load client configuration into configuration variables
status   logout()   logout function
string   now()   generate sql time string for current time
array   select()   select database rows
array   selectOne()   select one single database row
boolean   setPW()   set password for user
boolean   switchToClientDB()   switch to client database - if necessary
string   table()   return real table name
string   time()   generate sql time string from unix timestamp
boolean   update()   update table
boolean   updateClient()   update client
boolean   updateClientConf()   update client configuration
boolean   updateSysConf()   update system configuration
boolean   updateUser()   update user
boolean   updateUserConf()   update user configuration

[ Top ]
Properties
array   $conf = false [line 77]

configuration data


[ Top ]
array   $user = false [line 84]

user data


[ Top ]
string   $_clientTables = array() [line 70]

client tables


[ Top ]
object   $_db = false [line 56]

database resource


[ Top ]
string   $_prefix = '' [line 63]

table prefix


[ Top ]
Methods
Constructor eaDB  [line 95]

  eaDB eaDB( array &$conf, [boolean $debug = false]  )

constructor of database wrapper

defines the environmental db settings and starts session if not already done

Parameters:
array   &$conf:  configuration data
boolean   $debug:  enable adobdb debug (false)


[ Top ]
addUserToClient  [line 591]

  boolean addUserToClient( integer $client, string $user  )

add user to client

Parameters:
integer   $client:  client ID
string   $user:  email address

API Tags:
Return:  status


[ Top ]
checkLogin  [line 202]

  array checkLogin( eaInput &$in  )

login validation

Parameters:
eaInput   &$in:  input values

API Tags:
Return:  user data | false


[ Top ]
createClient  [line 398]

  boolean createClient( array &$data, [array $user = false], [ $demo = false]  )

create client

Parameters:
array   &$data:  client data
array   $user:  optional user data
   $demo: 

API Tags:
Return:  status


[ Top ]
createUser  [line 276]

  boolean createUser( string/array $user, [string $pw = '']  )

create user

Parameters:
string/array   $user:  username/userdata
string   $pw:  password (optional if userdata)

API Tags:
Return:  status


[ Top ]
decrypt  [line 767]

  string decrypt( string $string, [string $key = false]  )

decrypt string

Parameters:
string   $string:  string to decrypt
string   $key:  key [dsn]

API Tags:
Return:  decrypted string


[ Top ]
delete  [line 853]

  boolean delete( string $table, [string/array $where = '']  )

delete datasets

Parameters:
string   $table:  table
string/array   $where:  conditions

API Tags:
Return:  result


[ Top ]
deleteClient  [line 459]

  boolean deleteClient( integer $id  )

delete client

Parameters:
integer   $id:  client id

API Tags:
Return:  status


[ Top ]
deleteUser  [line 330]

  boolean deleteUser( string $user  )

delete user

Parameters:
string   $user:  username

API Tags:
Return:  status


[ Top ]
delUserClient  [line 615]

  boolean delUserClient( integer $client, integer $user  )

remove user from client

Parameters:
integer   $client:  clientID
integer   $user:  userID

API Tags:
Return:  status


[ Top ]
drop  [line 886]

  boolean drop( string $table  )

drop table

Parameters:
string   $table:  table

API Tags:
Return:  result


[ Top ]
encrypt  [line 751]

  string encrypt( string $string, [string $key = false]  )

encrypt string

Parameters:
string   $string:  string to encrypt
string   $key:  key [dsn]

API Tags:
Return:  encrypted string


[ Top ]
error  [line 190]

  boolean error( )

checks for database error


API Tags:
Return:  status


[ Top ]
escape  [line 728]

  string escape( string $string, [ $noQuote = false]  )

escape value string

Parameters:
string   $string:  string to escape
   $noQuote: 

API Tags:
Return:  escaped string


[ Top ]
escapeKey  [line 740]

  string escapeKey( string $string  )

escape key string

Parameters:
string   $string:  string to escape

API Tags:
Return:  escaped string


[ Top ]
getClientConf  [line 542]

  array getClientConf( integer $id  )

get client configuration variables

Parameters:
integer   $id:  clientID

API Tags:
Return:  configuration data


[ Top ]
getClients  [line 495]

  boolean getClients( eaInput &$in  )

get assigned clients

Parameters:
eaInput   &$in:  input values

API Tags:
Return:  status


[ Top ]
getClientUsers  [line 631]

  array getClientUsers( integer $id  )

get client users

Parameters:
integer   $id:  client ID

API Tags:
Return:  user data


[ Top ]
getSysConf  [line 648]

  array getSysConf( string 0  )

get system configuration variables

Parameters:
string   0:  username

API Tags:
Return:  configuration data


[ Top ]
getUserConf  [line 367]

  array getUserConf( )

get user configuration variables


API Tags:
Return:  configuration data


[ Top ]
insert  [line 794]

  boolean insert( array $what, string $table  )

insert array into table

Parameters:
array   $what:  key => value
string   $table:  table

API Tags:
Return:  result


[ Top ]
isOwner  [line 518]

  boolean isOwner( integer $id  )

checks if user is owner

Parameters:
integer   $id:  clientID

API Tags:
Return:  status


[ Top ]
isUser  [line 255]

  boolean/string isUser( string $name, [ $get = 'name']  )

checks if user exists

Parameters:
string   $name:  username
   $get: 

API Tags:
Return:  status/name


[ Top ]
lastID  [line 876]

  integer lastID( )

get last inserted id


API Tags:
Return:  last id


[ Top ]
loadClientConf  [line 554]

  integer loadClientConf( integer $id  )

load client configuration into configuration variables

Parameters:
integer   $id:  clientID

API Tags:
Return:  clientID


[ Top ]
logout  [line 243]

  status logout( )

logout function

deletes session data



[ Top ]
now  [line 909]

  string now( integer 0  )

generate sql time string for current time

Parameters:
integer   0:  unix time stamp

API Tags:
Return:  sql time string


[ Top ]
select  [line 695]

  array select( string $what, [string $table = ''], [string/array $where = ''], [string $order = ''], [integer $rows = -1], [integer $offset = -1], [string $group = '']  )

select database rows

Parameters:
string   $what:  columns
string   $table:  table
string/array   $where:  conditions
string   $order:  sorting
integer   $rows:  number of rows
integer   $offset:  offset
string   $group:  group by

API Tags:
Return:  result


[ Top ]
selectOne  [line 679]

  array selectOne( string $what, [string $table = ''], [string/array $where = ''], [string $order = '']  )

select one single database row

Parameters:
string   $what:  columns
string   $table:  table
string/array   $where:  conditions
string   $order:  sorting

API Tags:
Return:  result


[ Top ]
setPW  [line 358]

  boolean setPW( string $user, string $pw  )

set password for user

Parameters:
string   $user:  username
string   $pw:  password

API Tags:
Return:  status


[ Top ]
switchToClientDB  [line 159]

  boolean switchToClientDB( integer $client  )

switch to client database - if necessary

Parameters:
integer   $client:  clientID

API Tags:
Return:  status


[ Top ]
table  [line 782]

  string table( string $string  )

return real table name

Parameters:
string   $string:  preliminary table name

API Tags:
Return:  table name


[ Top ]
time  [line 899]

  string time( integer $time  )

generate sql time string from unix timestamp

Parameters:
integer   $time:  unix time stamp

API Tags:
Return:  sql time string


[ Top ]
update  [line 817]

  boolean update( string/array $what, string $table, [string/array $where = '']  )

update table

Parameters:
string/array   $what:  sql string / key => value
string   $table:  table
string/array   $where:  conditions

API Tags:
Return:  result


[ Top ]
updateClient  [line 442]

  boolean updateClient( integer $id, array $data  )

update client

Parameters:
integer   $id:  clientID
array   $data:  new client data

API Tags:
Return:  status


[ Top ]
updateClientConf  [line 573]

  boolean updateClientConf( integer $id, array $changed  )

update client configuration

Parameters:
integer   $id:  client ID
array   $changed:  changed configruration

API Tags:
Return:  status


[ Top ]
updateSysConf  [line 660]

  boolean updateSysConf( array $changed  )

update system configuration

Parameters:
array   $changed:  changed configruration

API Tags:
Return:  status


[ Top ]
updateUser  [line 303]

  boolean updateUser( string $oldUser, array $userData, [boolean $session = false]  )

update user

Parameters:
string   $oldUser:  old user
array   $userData:  new userdata
boolean   $session:  change session

API Tags:
Return:  status


[ Top ]
updateUserConf  [line 380]

  boolean updateUserConf( integer $userID, array $changed  )

update user configuration

Parameters:
integer   $userID:  user ID
array   $changed:  changed configruration

API Tags:
Return:  status


[ Top ]

Documentation generated on Sun, 09 Sep 2007 17:08:27 +0200 by phpDocumentor 1.3.1