Class jDb

Description

factory for database connector and other db utilities

Located in /db/jDb.class.php (line 27)


	
			
Method Summary
static void createVirtualProfile ( $name,  $params)
static void floatToStr ( $value)
static jDbConnection getConnection ([string $name = null])
static jDbWidget getDbWidget ([string $name = null])
static void getProfil ([ $name = ''], [ $nameIsProfileType = false])
static array getProfile ([string $name = ''], [boolean $nameIsProfileType = false])
static jDbTools getTools ([string $name = null])
boolean testProfile (array $profile)
Methods
static createVirtualProfile (line 186)
  • access: public
static void createVirtualProfile ( $name,  $params)
  • $name
  • $params
static floatToStr (line 209)

perform a convertion float to str. It takes care about the decimal separator which should be a '.' for SQL. Because when doing a native convertion float->str, PHP uses the local decimal separator, and so, we don't want that.

  • since: 1.1.11
  • access: public
static void floatToStr ( $value)
  • $value
static getConnection (line 38)

return a database connector Use a local pool.

  • return: connector
  • access: public
static jDbConnection getConnection ([string $name = null])
  • string $name: profile name to use. if empty, use the default one
static getDbWidget (line 58)

create a new jDbWidget

  • access: public
static jDbWidget getDbWidget ([string $name = null])
  • string $name: profile name to use. if empty, use the default one
static getProfil (line 140)

DEPRECATED. same as getProfile

  • deprecated:
  • access: public
static void getProfil ([ $name = ''], [ $nameIsProfileType = false])
  • $name
  • $nameIsProfileType
static getProfile (line 109)

load properties of a connector profile

a profile is a section in the dbprofils.ini.php file

with getProfile('myprofile') (or getProfile('myprofile', false)), you get the profile which has the name "myprofile". this name should correspond to a section name in the ini file

with getProfile('myprofiletype',true), it will search a parameter named 'myprofiletype' in the ini file. This parameter should contains a profile name, and the corresponding profile will be loaded.

with getProfile(), it will load the default profile, (so the profile of "default" type)

  • return: properties
  • access: public
static array getProfile ([string $name = ''], [boolean $nameIsProfileType = false])
  • string $name: profile name or profile type to load. if empty, use the default one
  • boolean $nameIsProfileType: says if the name is a profile name or a profile type. this parameter exists since 1.0b2
static getTools (line 68)

instancy a jDbTools object

  • access: public
static jDbTools getTools ([string $name = null])
  • string $name: profile name to use. if empty, use the default one
testProfile (line 150)

call it to test a profile (during an install for example)

  • return: true if properties are ok
  • access: public
boolean testProfile (array $profile)
  • array $profile: profile properties

Documentation generated on Thu, 22 Mar 2012 22:15:15 +0100 by phpDocumentor 1.4.3