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

Class: LiveUser_Admin_Storage_SQL

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

Class Overview

LiveUser_Admin_Storage
   |
   --LiveUser_Admin_Storage_SQL

This is a SQL backend driver for the LiveUser class.


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2002-2005 Markus Wolff

Variables

Methods


Child classes:

LiveUser_Admin_Storage_MDB2
This is a PEAR::MDB2 backend driver for the LiveUser class.
LiveUser_Admin_Storage_MDB
This is a PEAR::MDB backend driver for the LiveUser class.
LiveUser_Admin_Storage_DB
This is a PEAR::DB backend driver for the LiveUser class.

Inherited Variables

Inherited Methods

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 90]
This is a SQL backend driver for the LiveUser class.

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



[ Top ]


Class Variables

$prefix =  'liveuser_'

[line 115]

Table prefix Prefix for all db tables the container has.
  • Access: public

Type:   string


[ Top ]



Method Detail

createInsert   [line 181]

string createInsert( string $table, array $fields, array $values)

Create the SQL necessary for an insert
  • Return: SQL insert query
  • Access: public

Parameters:

string   $table   — 
array   $fields   — 
array   $values   — 

[ Top ]

createJoinFilter   [line 673]

boolean createJoinFilter( string $root_table, array $filters, array $tables, array $selectable_tables, [array $visited = array()])

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
  • Return: | array false on failure
  • Access: public

Parameters:

string   $root_table   — 
array   $filters   — 
array   $tables   — 
array   $selectable_tables   — 
array   $visited   — 

[ Top ]

createSelect   [line 375]

boolean createSelect( array $fields, array $filters, array $orders, string $root_table, array $selectable_tables)

Create the SQL necessary for a select
  • Return: | string false on failure or a string with SQL query
  • Access: public

Parameters:

array   $fields   — 
array   $filters   — 
array   $orders   — 
string   $root_table   — 
array   $selectable_tables   — 

[ Top ]

createUpdate   [line 240]

string createUpdate( string $table, array $fields, array $filters)

Create the SQL necessary for an update
  • Return: SQL update query
  • Access: public

Parameters:

string   $table   — 
array   $fields   — 
array   $filters   — 

[ Top ]

createWhere   [line 433]

boolean createWhere( array $filters, [array $joinfilters = array()])

Create the SQL necessary for a where statement
  • Return: | string false on failure or string with SQL WHERE
  • Access: public

Parameters:

array   $filters   — 
array   $joinfilters   — 

[ Top ]

delete   [line 258]

mixed delete( string $table, array $filters)

Update from a table based given filters
  • Return: false on error, the affected rows on success
  • Access: public

Parameters:

string   $table   — 
array   $filters   — 

[ Top ]

disconnect   [line 832]

void disconnect( )

Properly disconnect from database
  • Access: public

Overrides LiveUser_Admin_Storage::disconnect() (properly disconnect from resources)
[ Top ]

findTables   [line 534]

boolean findTables( array &$fields, array &$filters, array &$orders, array $selectable_tables)

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
  • Return: | array false on failure
  • Access: public

Parameters:

array   &$fields   — 
array   &$filters   — 
array   &$orders   — 
array   $selectable_tables   — 

[ Top ]

insert   [line 127]

mixed insert( string $table, array $data)

Insert data into a table
  • Return: false on error, true (or new id) on success
  • Access: public

Parameters:

string   $table   — 
array   $data   — 

[ Top ]

select   [line 328]

boolean select( array $select, array $fields, array $filters, array $orders, boolean $rekey, boolean $group, integer $limit, integer $offset, string $root_table, array $selectable_tables)

Select data from a set of tables
  • Return: | array false on failure or array with selected data
  • Access: public

Parameters:

array   $select   — 
array   $fields   — 
array   $filters   — 
array   $orders   — 
boolean   $rekey   — 
boolean   $group   — 
integer   $limit   — 
integer   $offset   — 
string   $root_table   — 
array   $selectable_tables   — 

[ Top ]

selectCount   [line 285]

boolean selectCount( string $table, string $field, array $filters)

Fetches the count of many rows contain the filtered data
  • Return: | integer false on failure and integer of how many rows contain the filtered data
  • Access: public

Parameters:

string   $table   — 
string   $field   — 
array   $filters   — 

[ Top ]

update   [line 200]

mixed update( string $table, array $data, $filters, array $filteres)

Update data in a table based given filters
  • Return: false on error, the affected rows on success
  • Access: public

Parameters:

string   $table   — 
array   $data   — 
array   $filteres   — 
   $filters   — 

[ Top ]


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