- Description
-
Class trees
Index of elements
Todo List
Interfaces
Phpfox_Cache_Interface
Phpfox_Database_Interface
Phpfox_Gateway_Interface
Phpfox_Image_Interface
Phpfox_Mail_Interface
Classes
Database_Driver_Mssql
Database_Driver_Oracle
Database_Driver_Postgres
Database_Driver_Sqlite
Phpfox
Phpfox_Ajax
Phpfox_Api
Phpfox_Archive
Phpfox_Archive_Export
Phpfox_Archive_Extension_Tar
Phpfox_Archive_Extension_Xml
Phpfox_Archive_Extension_Zip
Phpfox_Archive_Import
Phpfox_Archive_Support
Phpfox_Cache
Phpfox_Cache_Abstract
Phpfox_Cache_Storage_File
Phpfox_Cache_Storage_Memcache
Phpfox_Cdn
Phpfox_Cdn_Abstract
Phpfox_Cdn_Module_S3
Phpfox_Component
Phpfox_Cron
Phpfox_Database
Phpfox_Database_Dba
Phpfox_Database_Driver_Mysql
Phpfox_Database_Driver_Mysqli
Phpfox_Database_Export
Phpfox_Database_Support
Phpfox_Date
Phpfox_Debug
Phpfox_Diff_Md5
Phpfox_Editor
Phpfox_Error
Phpfox_File
Phpfox_File_Minimize
Phpfox_Ftp
Phpfox_Gateway
Phpfox_Gateway_Api_2checkout
Phpfox_Gateway_Api_Paypal
Phpfox_Hash
Phpfox_Image
Phpfox_Image_Abstract
Phpfox_Image_Helper
Phpfox_Image_Library_Gd
Phpfox_Locale
Phpfox_Mail
Phpfox_Mail_Driver_Phpmailer_Mail
Phpfox_Mail_Driver_Phpmailer_Smtp
Phpfox_Module
Phpfox_Pager
Phpfox_Parse_Bbcode
Phpfox_Parse_Css
Phpfox_Parse_Format
Phpfox_Parse_Input
Phpfox_Parse_Output
Phpfox_Parse_Wiki
Phpfox_Plugin
Phpfox_Process
Phpfox_Request
Phpfox_Search
Phpfox_Search_Inline
Phpfox_Server
Phpfox_Service
Phpfox_Session
Phpfox_Session_Handler
Phpfox_Session_Handler_Default
Phpfox_Session_Handler_File
Phpfox_Session_Handler_Memcache
Phpfox_Session_Storage_Cookie
Phpfox_Session_Storage_Session
Phpfox_Setting
Phpfox_Spam
Phpfox_Spam_Hash
Phpfox_Template
Phpfox_Url
Phpfox_Validator
Phpfox_Xml_Builder
Phpfox_Xml_Parser
Functions
d
e
p
Files
2checkout.class.php
abstract.class.php
abstract.class.php
abstract.class.php
ajax.class.php
api.class.php
archive.class.php
bbcode.class.php
builder.class.php
cache.class.php
cdn.class.php
component.class.php
cookie.class.php
cron.class.php
css.class.php
database.class.php
date.class.php
dba.class.php
debug.class.php
default.class.php
editor.class.php
error.class.php
export.class.php
export.class.php
file.class.php
file.class.php
file.class.php
format.class.php
ftp.class.php
gateway.class.php
gd.class.php
handler.class.php
hash.class.php
hash.class.php
helper.class.php
image.class.php
import.class.php
inline.class.php
input.class.php
interface.class.php
interface.class.php
interface.class.php
interface.class.php
interface.class.php
locale.class.php
mail.class.php
mail.class.php
md5.class.php
memcache.class.php
memcache.class.php
minimize.class.php
module.class.php
mssql.class.php
mysql.class.php
mysqli.class.php
oracle.class.php
output.class.php
pager.class.php
parser.class.php
paypal.class.php
phpfox.class.php
plugin.class.php
postgres.class.php
process.class.php
request.class.php
s3.class.php
search.class.php
server.class.php
service.class.php
session.class.php
session.class.php
setting.class.php
smtp.class.php
spam.class.php
sqlite.class.php
support.class.php
support.class.php
tar.class.php
template.class.php
url.class.php
validator.class.php
wiki.class.php
xml.class.php
zip.class.php
Template-
Classes
Phpfox_Template_Cache
Files
cache.class.php
Phpfox_Database_Dba
Implements interfaces:
Parent class for all SQL drivers. Each driver needs to interact with this class in case any modifications need to be done to a query.
Located in /include/library/phpfox/database/dba.class.php (line 19)
| Class | Description |
|---|---|
Phpfox_Database_Driver_Mysql
|
Database driver for MySQL. |
int
insert
(string $sTable, [array $aValues = array()], [boolean $bEscape = true], [ $bReturnQuery = false])
boolean
update
(string $sTable, [array $aValues = array()], [string $sCond = null], [boolean $bEscape = true])
void
updateCount
(string $sCountTable, array $aCountCond, string $sCounter, string $sUpdateTable, array $aUpdateCond)
void
updateCounter
(string $sTable, string $sCounter, string $sField, int $iId, [bool $bMinus = false])
array
$_aData
= array() (line 44)
Holds all the data that has been filtered when inserting or updating information directly from a from posted by an end user.
array
$_aQuery
= array() (line 27)
Array of all the parts of a query we are going to execute
array
$_aWords
= array() (line 36)
Array of all the words that cannot be used when creating a database table or field. This is only used in development mode.
Constructor __construct (line 51)
Class constructor. If we are in development mode we store all the words that cannot be used when creating tables or fields.
clean (line 472)
We clean out the query we just ran so another query can be built
delete (line 651)
Delete entry from the database
- string $sTable: is the table name
- string $sQuery: is the query we will run
- $iLimit
dropTables (line 667)
Drops tables from the database
- string $aDrops: Array of tables to drop
- array $aVals: Not being used at the moment.
execute (line 389)
Performs the final SQL query with all the information we have gathered from various other methods in this class. Via this method you can perform all tasks from getting a single field from a row, to just one row or a list of rows.
- string $sType: The command we plan to execute. It can also be NULL or empty and will simply return the SQL query itself without executing it.
- array $aParams: Any special commands that we need to run can be passed here. Mainly used if we were to cache the actual query.
from (line 224)
Stores the FROM part of a query
- string $sTable: Table to query
- string $sAlias: Optional usage of alias can be passed here
getField (line 152)
Returns one field from a row
- string $sSql: SQL query
getRow (line 129)
Returns one row
- string $sSql: SQL query
- bool $bAssoc: True to return an associative array
getRows (line 141)
Returns several rows
- string $sSql: SQL query
- bool $bAssoc: True to return an associative array
getSlaveField (line 87)
Returns one field from a row using a slave connection
- string $sSql: SQL query
getSlaveRow (line 101)
Returns one row using a slave connection
- string $sSql: SQL query
- bool $bAssoc: True to return an associative array
getSlaveRows (line 115)
Returns several rows using a slave connection
- string $sSql: SQL query
- bool $bAssoc: True to return an associative array
group (line 260)
Stores the GROUP BY part of a query
- string $sGroup: SQL GROUP BY command
having (line 274)
Stores the HAVING part of a query
- string $sHaving: SQL HAVING command
innerJoin (line 320)
Creates a INNER JOIN for an SQL query.
Example of left joining tables:
- string $sTable: Table to join
- string $sAlias: Alias to use to identify the table and make it unique
- mixed $mParam: Can be a string or an array of how to link the tables. This is usually a string that contains the part found with an SQL ON(__STRING__)
insert (line 528)
Performs insert of one row. Accepts values to insert as an array: 'column1' => 'value1' 'column2' => 'value2'
- string $sTable: table name
- array $aValues: column and values to insert
- boolean $bEscape: true - method escapes values (with "), false - not escapes
- $bReturnQuery
join (line 343)
Creates a JOIN for an SQL query.
Example of left joining tables:
- string $sTable: Table to join
- string $sAlias: Alias to use to identify the table and make it unique
- mixed $mParam: Can be a string or an array of how to link the tables. This is usually a string that contains the part found with an SQL ON(__STRING__)
leftJoin (line 297)
Creates a LEFT JOIN for an SQL query.
Example of left joining tables:
- string $sTable: Table to join
- string $sAlias: Alias to use to identify the table and make it unique
- mixed $mParam: Can be a string or an array of how to link the tables. This is usually a string that contains the part found with an SQL ON(__STRING__)
limit (line 361)
Stores the LIMIT/OFFSET part of a query. It can also be used to create a pagination if params 2 and 3 and filled otherwise it bahaves just as a limit on the SQL query.
- int $iPage: If $sLimit and $iCnt are NULL then this value is the LIMIT on the SQL query. However if $sLimit and $iCnt are not NULL then this value is the current page we are on.
- string $sLimit: Is how many to limit per query
- int $iCnt: Is how many rows there are in this query
multiInsert (line 578)
Runs an SQL query to run one SQL query and insert multiple rows. The 2nd and 3rd params much match in order to inser the data correctly.
- string $sTable: Table to insert the data
- array $aFields: Array of table fields
- array $aValues: Array of values to insert that matches the table fields
order (line 243)
Stores the ORDER part of a query
- string $sOrder: SQL ORDER BY command
process (line 484)
Process data from a form a end-user posted and prepare it to be used when inserting/updating records
- array $aFields: Array of rules of the fields that are allowed and the type it must be
- array $aVals: $_POST fields from a form
select (line 164)
Stores the SELECT part of a query
- string $sSelect: Select part of an SQL query
update (line 618)
Performs update of rows.
- string $sTable: table name
- array $aValues: array of column=>new_value
- string $sCond: condition (without WHERE)
- boolean $bEscape: true - method escapes values (with "), false - not escapes
updateCount (line 712)
This in practice works similar to our previous method self::updateCounter(), however instead of increasing or decreasing a field it checks the table to see how many rows there are and updates the static field with that count. This is usually only used in the AdminCP to fix broken counters.
- string $sCountTable: Table to check how many rows there are
- array $aCountCond: SQL conditional statement for the table we are checking
- string $sCounter: Field name of the table we are updating the static count
- string $sUpdateTable: Table we are going to be updating with the new count number
- array $aUpdateCond: SQL conditional statment for the table we are updating
updateCounter (line 693)
Updates a int field in the database to increase or decrease its count.
We usually use this to cache information about a user. Lets take for example a user has 10 friends and instead of running a query to the database to check how many friends they have we just store a static count in the database. So when they add or remove a friend we then either increase or decrease the static record.
Example:
- string $sTable: Table to update
- string $sCounter: Field we are going to be updating. This is where the static value is
- string $sField: Field we need to identify the record we are going to be updating
- int $iId: ID of the field we are going to be updating
- bool $bMinus: False by default as we usually increase a count, if we decrease a count set this to true
where (line 194)
Stores the WHERE part of a query
Example using a string method:
- $aCond = array();
- $aCond[] = 'AND user_id = 1';
- $aCond[] = 'AND email = \'foo@bar.com\'';
- mixed $aConds: Can be a string of the WHERE part of an SQL query or an array or all the parts of an SQL query.
_getField (line 803)
Returns one field from a row
- string $sSql: SQL query
- resource $hLink: SQL resource
- &$hLink
_insert (line 776)
Insert data into the database
- string $sTable: Database table
- string $sFields: List of fields
- string $sValues: List of values
_join (line 733)
Performs all the joins based on information passed from JOIN methods within this class.
- string $sType: The type of join we are going to use (LEFT JOIN, JOIN, INNER JOIM)
- string $sTable: Table to join
- string $sAlias: Alias to use to identify the table and make it unique
- mixed $mParam: Can be a string or an array of how to link the tables. This is usually a string that contains the part found with an SQL ON(__STRING__)
_update (line 791)
Updates data in a specific table
- string $sTable: Table we are updating
- string $sSets: SQL SET command
- string $sCond: SQL WHERE command
Documentation generated on Tue, 28 Sep 2010 10:36:38 +0200 by phpDocumentor 1.4.0a2