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

Class: LiveUser_Admin_Storage_MDB

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

Class Overview

LiveUser_Admin_Storage
   |
   --LiveUser_Admin_Storage_SQL
      |
      --LiveUser_Admin_Storage_MDB

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


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2002-2005 Markus Wolff

Methods


Child classes:

LiveUser_Admin_Auth_Storage_MDB
This is a PEAR::MDB backend driver for the LiveUser class.
LiveUser_Admin_Perm_Storage_MDB
This is a PEAR::MDB 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::MDB backend driver for the LiveUser class.

A PEAR::MDB 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::MDB connection object must be passed to the constructor. Example: array('dsn' => 'mysql://user:pass@host/db_name') OR &$conn (PEAR::MDB connection object)



[ Top ]


Method Detail

getAfterId   [line 401]

integer getAfterId( string $id, string $table)

returns the autoincrement ID if supported or $id

getAfterId isn't implemented in MDB 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 376]

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: MDB::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 168]

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: MDB::getValue

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_MDB::init()
Initializes database storage container.
LiveUser_Admin_Perm_Storage_MDB::init()
Initializes database storage container.

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

Parameters:

array   &$storageConf   —  Storage Configuration

[ Top ]

nextId   [line 351]

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

returns the next free id of a sequence
  • Return: | integer
  • Access: public
  • Uses: MDB::nextId

Parameters:

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

[ Top ]

query   [line 206]

boolean query( string $query)

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

Parameters:

string   $query   —  query

[ Top ]

queryAll   [line 327]

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: MDB::queryAll

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 293]

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: MDB::queryCol

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 234]

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: MDB::queryOne

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 266]

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: MDB::queryRow

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 151]

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: MDB::getValue

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 190]

void setLimit( string $limit, string $offset)

Sets the range of the next query
  • Access: public
  • Uses: MDB::setSelectedRowRange

Parameters:

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

[ Top ]


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