LiveUser_Admin
[ class tree: LiveUser_Admin ] [ index: LiveUser_Admin ] [ all elements ]

Class: LiveUser_Admin_Storage_DB

Source Location: /LiveUser_Admin-0.3.3/Storage/DB.php

Class Overview

LiveUser_Admin_Storage
   |
   --LiveUser_Admin_Storage_SQL
      |
      --LiveUser_Admin_Storage_DB

This is a PEAR::DB backend driver for the LiveUser class.


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2002-2005 Markus Wolff

Methods


Child classes:

LiveUser_Admin_Auth_Storage_DB
This is a PEAR::DB backend driver for the LiveUser class.
LiveUser_Admin_Perm_Storage_DB
This is a PEAR::DB backend driver for the LiveUser class.

Inherited Variables

Inherited Methods

Class: LiveUser_Admin_Storage_SQL

LiveUser_Admin_Storage_SQL::createInsert()
Create the SQL necessary for an insert
LiveUser_Admin_Storage_SQL::createJoinFilter()
Recursively find all the tables that need to be joined to be able to select all requested columns and to be able to filter the joined rows
LiveUser_Admin_Storage_SQL::createSelect()
Create the SQL necessary for a select
LiveUser_Admin_Storage_SQL::createUpdate()
Create the SQL necessary for an update
LiveUser_Admin_Storage_SQL::createWhere()
Create the SQL necessary for a where statement
LiveUser_Admin_Storage_SQL::delete()
Update from a table based given filters
LiveUser_Admin_Storage_SQL::disconnect()
Properly disconnect from database
LiveUser_Admin_Storage_SQL::findTables()
Find all the tables that need to be joined to be able to select all requested columns and to be able to filter the joined rows
LiveUser_Admin_Storage_SQL::insert()
Insert data into a table
LiveUser_Admin_Storage_SQL::select()
Select data from a set of tables
LiveUser_Admin_Storage_SQL::selectCount()
Fetches the count of many rows contain the filtered data
LiveUser_Admin_Storage_SQL::update()
Update data in a table based given filters

Class: LiveUser_Admin_Storage

LiveUser_Admin_Storage::LiveUser_Admin_Storage()
Constructor
LiveUser_Admin_Storage::disconnect()
properly disconnect from resources
LiveUser_Admin_Storage::init()
Initializes database storage container.

Class Details

[line 92]
This is a PEAR::DB backend driver for the LiveUser class.

A PEAR::DB connection object can be passed to the constructor to reuse an existing connection. Alternatively, a DSN can be passed to open a new one.

Requirements:

  • File "Liveuser.php" (contains the parent class "LiveUser")
  • Array of connection options or a PEAR::DB connection object must be passed to the constructor. Example: array('dsn' => 'mysql://user:pass@host/db_name') OR &$conn (PEAR::DB connection object)



[ Top ]


Method Detail

getAfterId   [line 393]

integer getAfterId( string $id, string $table)

returns the autoincrement ID if supported or $id

getAfterId isn't implemented in DB so we return the $id that was passed by the user

  • Return: returns the id that the users passed via params
  • Access: public

Parameters:

string   $id   —  value as returned by getBeforeId()
string   $table   —  name of the table into which a new row was inserted

[ Top ]

getBeforeId   [line 368]

boolean getBeforeId( string $table, [boolean $ondemand = true])

returns the next free id of a sequence if the RDBMS does not support auto increment
  • Return: | integer
  • Access: public
  • Uses: DB::nextId

Parameters:

string   $table   —  name of the table into which a new row was inserted
boolean   $ondemand   —  when true the seqence is automatic created, if it not exists

[ Top ]

implodeArray   [line 159]

string implodeArray( array $array, string $type)

Apply a type to all values of an array and return as a comma seperated string useful for generating IN statements
  • Return: comma seperated values
  • Access: public
  • Uses: DB::quoteSmart

Parameters:

array   $array   —  data array
string   $type   —  determines type of the field

[ Top ]

init   [line 104]

boolean init( array &$storageConf)

Initializes database storage container.

Connects to database or uses existing database connection.

  • Return: false on failure and true on success
  • Access: public
  • Uses: LiveUser_Admin_Storage_SQL::init

Overridden in child classes as:

LiveUser_Admin_Auth_Storage_DB::init()
Initializes database storage container.
LiveUser_Admin_Perm_Storage_DB::init()
Initializes database storage container.

Overrides LiveUser_Admin_Storage::init() (Initializes database storage container.)

Parameters:

array   &$storageConf   —  Storage Configuration

[ Top ]

nextId   [line 343]

boolean nextId( string $seqname, [boolean $ondemand = true])

returns the next free id of a sequence
  • Return: | integer false on failure or next id for the table
  • Access: public
  • Uses: DB::nextId

Parameters:

string   $seqname   —  name of the sequence
boolean   $ondemand   —  when true the seqence is automatic created, if it not exists

[ Top ]

query   [line 201]

boolean query( string $query)

Execute query
  • Return: | integer
  • Access: public
  • Uses: DB::query - DB::affectedRows

Parameters:

string   $query   —  query

[ Top ]

queryAll   [line 315]

boolean queryAll( string $query, array $types, boolean $rekey, boolean $group)

Execute the specified query, fetch all the rows of the result set into a two dimensional array and then frees the result set.
  • Return: | array
  • Access: public
  • Uses: DB::getAll - DB::getAssoc

Parameters:

string   $query   —  the SELECT query statement to be executed.
array   $types   —  array argument that specifies a list of expected datatypes of the result set columns, so that the eventual conversions may be performed. The default list of datatypes is empty, meaning that no conversion is performed.
boolean   $rekey   —  if set to true, the $all will have the first column as its first dimension
boolean   $group   —  if set to true and $rekey is set to true, then all values with the same first column will be wrapped in an array

[ Top ]

queryCol   [line 284]

boolean queryCol( string $query, string $type)

Execute the specified query, fetch the value from the first column of each row of the result set into an array and then frees the result set.
  • Return: | array
  • Access: public
  • Uses: DB::getCol

Parameters:

string   $query   —  the SELECT query statement to be executed.
string   $type   —  argument that specifies the expected datatype of the result set field, so that an eventual conversion may be performed. The default datatype is text, meaning that no conversion is performed

[ Top ]

queryOne   [line 229]

boolean queryOne( string $query, string $type)

Execute the specified query, fetch the value from the first column of the first row of the result set and then frees the result set.
  • Return: | array
  • Access: public
  • Uses: DB::getOne

Parameters:

string   $query   —  the SELECT query statement to be executed.
string   $type   —  argument that specifies the expected datatype of the result set field, so that an eventual conversion may be performed. The default datatype is text, meaning that no conversion is performed

[ Top ]

queryRow   [line 257]

boolean queryRow( string $query, array $type)

Execute the specified query, fetch the values from the first row of the result set into an array and then frees the result set.
  • Return: | array
  • Access: public
  • Uses: DB::getRow

Parameters:

string   $query   —  the SELECT query statement to be executed.
array   $type   —  array argument that specifies a list of expected datatypes of the result set columns, so that the eventual conversions may be performed. The default list of datatypes is empty, meaning that no conversion is performed.

[ Top ]

quote   [line 143]

stringtext quote( string $value, string $type)

Convert a text value into a DBMS specific format that is suitable to compose query statements.
  • Return: string that represents the given argument value in a DBMS specific format.
  • Access: public
  • Uses: DB::quoteSmart

Parameters:

string   $value   —  text string value that is intended to be converted.
string   $type   —  type to which the value should be converted to

[ Top ]

setLimit   [line 181]

boolean setLimit( string $limit, string $offset)

This function is not implemented into DB so we can't make use of it.
  • Return: false This feature isn't supported by DB
  • Access: public

Parameters:

string   $limit   —  number of rows to select
string   $offset   —  first row to select

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:16:43 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.