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

Class: LiveUser_Admin_Storage_PDO

Source Location: /LiveUser_Admin-0.4.0/Storage/PDO.php

Class Overview

LiveUser_Admin_Storage
   |
   --LiveUser_Admin_Storage_SQL
      |
      --LiveUser_Admin_Storage_PDO

This is a PECL::PDO backend driver for the LiveUser class.


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2002-2006 Markus Wolff

Methods


Child classes:

LiveUser_Admin_Auth_Storage_PDO
This is a PECL::PDO backend storage driver for the LiveUser Admin auth class.
LiveUser_Admin_Perm_Storage_PDO
This is a PECL::PDO backend storage driver for the LiveUser_Admin perm class.

Inherited Variables

Inherited Methods

Class: LiveUser_Admin_Storage_SQL

LiveUser_Admin_Storage_SQL::createDelete()
Create the SQL necessary for an delete
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()
Delete 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.
LiveUser_Admin_Storage::setSelectDefaultParams()
Static method to set defaults into a select params array

Class Details

[line 90]
This is a PECL::PDO backend driver for the LiveUser class.

A PECL::PDO 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/Admin.php" (contains the parent class "LiveUser_Admin")
  • Array of connection options or a PECL::PDO connection object must be passed to the init() method Example: array('dsn' => 'mysql:host:localhost;dbname=db_name', 'options' => array('username' => 'root', 'password' => 'secret', 'attr' => array()));



[ Top ]


Method Detail

exec   [line 220]

bool|int exec( string $query)

Execute DML query
  • Return: of the affected rows
  • Access: public
  • Uses: DB::query - DB::affectedRows

Parameters:

string   $query   —  DML query

[ Top ]

getAfterId   [line 436]

int getAfterId( string $id, string $table)

Since DB does not support determining if auto increment is supported, the call just returns the $id parameter
  • 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 420]

bool|int getBeforeId( string $table, string $field, [bool $ondemand = true])

Since DB does not support determining if auto increment is supported, the call is redirected to nextID()
  • Access: public
  • Uses: MDB2::nextId - MDB2_Extended::getBeforeId

Parameters:

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

[ Top ]

implodeArray   [line 178]

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

bool init( array &$storageConf, array $structure)

Initializes database storage container.

Connects to database or uses existing database connection.

  • Return: true on success and false on failure
  • Access: public

Overridden in child classes as:

LiveUser_Admin_Auth_Storage_PDO::init()
Initializes database storage container.
LiveUser_Admin_Perm_Storage_PDO::init()
Initializes database storage container.

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

Parameters:

array   &$storageConf   —  Storage Configuration
array   $structure   —  containing the database structure (tables, fields, alias)

[ Top ]

nextId   [line 399]

bool|int nextId( string $seqname, [bool $ondemand = true])

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

Parameters:

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

[ Top ]

queryAll   [line 347]

bool|array queryAll( string $query, array $types, bool $rekey, bool $group)

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

Parameters:

string   $query   —  the SELECT query statement to be executed.
array   $types   —  argument that specifies a list of expected datatypes of theresult set columns, so that the conversions may be performed. The default datatype is text, meaning no conversion is performed.
bool   $rekey   —  if set to true, returned array will have the first column as its first dimension
bool   $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 313]

bool|array 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.
  • 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 no conversion is performed.

[ Top ]

queryOne   [line 249]

bool|string 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.
  • 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 no conversion is performed.

[ Top ]

queryRow   [line 280]

bool|array 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.
  • Access: public
  • Uses: DB::getRow

Parameters:

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

[ Top ]

quote   [line 162]

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

bool 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 15:39:43 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.