XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
DBMssql Class Reference
Inheritance diagram for DBMssql:
DB

Public Member Functions

 __construct ($auto_connect=TRUE)
 
 create ()
 
 __connect ($connection)
 
 _close ($connection)
 
 addQuotes ($string)
 
 _begin ($transactionLevel=0)
 
 _rollback ($transactionLevel=0)
 
 _commit ()
 
 __query ($query, $connection)
 
 _getParametersByReference ($_param)
 
 _fetch ($result, $arrayIndexEndValue=NULL)
 
 getNextSequence ()
 
 isTableExists ($target_name)
 
 addColumn ($table_name, $column_name, $type= 'number', $size= '', $default=null, $notnull=false)
 
 dropColumn ($table_name, $column_name)
 
 isColumnExists ($table_name, $column_name)
 
 addIndex ($table_name, $index_name, $target_columns, $is_unique=false)
 
 dropIndex ($table_name, $index_name, $is_unique=false)
 
 isIndexExists ($table_name, $index_name)
 
 createTableByXml ($xml_doc)
 
 createTableByXmlFile ($file_name)
 
 _createTable ($xml_doc)
 
 _executeInsertAct ($queryObject)
 
 _executeUpdateAct ($queryObject)
 
 getUpdateSql ($query, $with_values=true, $with_priority=false)
 
 _executeDeleteAct ($queryObject)
 
 getSelectSql ($query, $with_values=TRUE, $connection=NULL)
 
 _executeSelectAct ($queryObject, $connection=null)
 
 getParser ($force=FALSE)
 
 queryError ($queryObject)
 
 queryPageLimit ($queryObject, $result, $connection)
 
- Public Member Functions inherited from DB
 getInstance ($db_type=NULL)
 
 create ()
 
 __construct ()
 
 getSupportedList ()
 
 _getSupportedList ()
 
 _sortDBMS ($a, $b)
 
 isSupported ()
 
 isConnected ($type= 'master', $indx=0)
 
 actStart ($query)
 
 actFinish ()
 
 setQueryLog ($log)
 
 setError ($errno=0, $errstr= 'success')
 
 isError ()
 
 getError ()
 
 executeQuery ($query_id, $args=NULL, $arg_columns=NULL, $type=NULL)
 
 checkQueryCacheFile ($query_id, $xml_file)
 
 _executeQuery ($cache_file, $source_args, $query_id, $arg_columns, $type)
 
 getCountCache ($tables, $condition)
 
 putCountCache ($tables, $condition, $count=0)
 
 resetCountCache ($tables)
 
 dropTable ($table_name)
 
 getSelectSql ($query, $with_values=TRUE)
 
 getClickCountQuery ($queryObject)
 
 getDeleteSql ($query, $with_values=TRUE, $with_priority=FALSE)
 
 getUpdateSql ($query, $with_values=TRUE, $with_priority=FALSE)
 
 getInsertSql ($query, $with_values=TRUE, $with_priority=FALSE)
 
 _getSlaveConnectionStringIndex ()
 
 _getConnection ($type= 'master', $indx=NULL)
 
 _dbInfoExists ()
 
 _close ($connection)
 
 close ($type= 'master', $indx=0)
 
 _begin ($transactionLevel=0)
 
 begin ()
 
 _rollback ($transactionLevel=0)
 
 rollback ()
 
 _commit ()
 
 commit ($force=FALSE)
 
 __query ($query, $connection)
 
 _query ($query, $connection=NULL)
 
 _setDBInfo ()
 
 __connect ($connection)
 
 _afterConnect ($connection)
 
 _connect ($type= 'master', $indx=0)
 
 actDBClassStart ()
 
 actDBClassFinish ()
 
 getParser ($force=FALSE)
 

Public Attributes

 $prefix = 'xe'
 
 $param = array()
 
 $comment_syntax = '/* %s */'
 
 $column_type
 
- Public Attributes inherited from DB
 $priority_dbms
 
 $count_cache_path = 'files/cache/db'
 
 $cond_operation
 
 $master_db = NULL
 
 $slave_db = NULL
 
 $result = NULL
 
 $errno = 0
 
 $errstr = ''
 
 $query = ''
 
 $connection = ''
 
 $elapsed_time = 0
 
 $elapsed_dbclass_time = 0
 
 $transaction_started = FALSE
 
 $is_connected = FALSE
 
 $cache_file = 'files/cache/queries/'
 
 $db_type
 
 $use_prepared_statements
 

Additional Inherited Members

- Static Public Member Functions inherited from DB
static getEnableList ()
 
static getDisableList ()
 
- Static Public Attributes inherited from DB
static $isSupported = FALSE
 
static $supported_list = array()
 

Detailed Description

Definition at line 12 of file DBMssql.class.php.

Constructor & Destructor Documentation

DBMssql::__construct (   $auto_connect = TRUE)

Constructor

Returns
void

Definition at line 45 of file DBMssql.class.php.

Member Function Documentation

DBMssql::__connect (   $connection)

DB Connect this method is private

Parameters
array$connectionconnection's value is db_hostname, db_database, db_userid, db_password
Returns
resource

Definition at line 66 of file DBMssql.class.php.

DBMssql::__query (   $query,
  $connection 
)

Execute the query this method is private

Parameters
string$query
resource$connection
Returns
resource|boolean Returns a statement resource on success and FALSE if an error occurred.

Definition at line 175 of file DBMssql.class.php.

DBMssql::_begin (   $transactionLevel = 0)

DB transaction start this method is private

Returns
boolean

Definition at line 116 of file DBMssql.class.php.

DBMssql::_close (   $connection)

DB disconnection this method is private

Parameters
resource$connection
Returns
void

Definition at line 88 of file DBMssql.class.php.

DBMssql::_commit ( )

DB transaction commit this method is private

Returns
boolean

Definition at line 161 of file DBMssql.class.php.

DBMssql::_createTable (   $xml_doc)

Create table by using the schema xml

type : number, varchar, tinytext, text, bigtext, char, date,
opt : notnull, default, size
index : primary key, index, unique

Parameters
string$xml_docxml schema contents
Returns
void|object

Definition at line 553 of file DBMssql.class.php.

DBMssql::_executeDeleteAct (   $queryObject)

Handles deleteAct

Parameters
BaseObject$queryObject
Returns
resource

Definition at line 720 of file DBMssql.class.php.

DBMssql::_executeInsertAct (   $queryObject)

Handles insertAct

Todo:
Lookup _filterNumber against sql injection - see if it is still needed and how to integrate
Parameters
BaseObject$queryObject
Returns
resource

Definition at line 656 of file DBMssql.class.php.

DBMssql::_executeSelectAct (   $queryObject,
  $connection = null 
)

Handle selectAct In order to get a list of pages easily when selecting
it supports a method as navigation

Parameters
BaseObject$queryObject
resource$connection
Returns
BaseObject

Definition at line 844 of file DBMssql.class.php.

DBMssql::_executeUpdateAct (   $queryObject)

Handles updateAct

Parameters
BaseObject$queryObject
Returns
resource

Definition at line 668 of file DBMssql.class.php.

DBMssql::_fetch (   $result,
  $arrayIndexEndValue = NULL 
)

Fetch results

Parameters
resource$result
int | NULL$arrayIndexEndValue
Returns
array

Definition at line 288 of file DBMssql.class.php.

DBMssql::_getParametersByReference (   $_param)

Parameters to sqlsrv_prepare need to be references, and not literals Parameters are sent as an array, where each parameter can be:

  • a PHP variable (by reference)
  • a PHP array (containng param value, type and direction) -> also needs to be sent by reference
    Parameters
    array$_param
    Returns
    array

Definition at line 257 of file DBMssql.class.php.

DBMssql::_rollback (   $transactionLevel = 0)

DB transaction rollback this method is private

Returns
boolean

Definition at line 139 of file DBMssql.class.php.

DBMssql::addColumn (   $table_name,
  $column_name,
  $type = 'number',
  $size = '',
  $default = null,
  $notnull = false 
)

Add a column to the table

Parameters
string$table_nametable name
string$column_namecolumn name
string$typecolumn type, default value is 'number'
int$sizecolumn size
string | int$defaultdefault value
boolean$notnullnot null status, default value is false
Returns
void

Definition at line 380 of file DBMssql.class.php.

DBMssql::addIndex (   $table_name,
  $index_name,
  $target_columns,
  $is_unique = false 
)

Add an index to the table $target_columns = array(col1, col2) $is_unique? unique : none

Parameters
string$table_nametable name
string$index_nameindex name
string | array$target_columnstarget column or columns
boolean$is_unique
Returns
void

Definition at line 462 of file DBMssql.class.php.

DBMssql::addQuotes (   $string)

Handles quatation of the string variables from the query

Todo:
See what to do about this
Parameters
string$string
Returns
string

Definition at line 100 of file DBMssql.class.php.

DBMssql::create ( )

Create an instance of this class

Returns
DBMssql return DBMssql object instance

Definition at line 55 of file DBMssql.class.php.

DBMssql::createTableByXml (   $xml_doc)

Creates a table by using xml contents

Parameters
string$xml_docxml schema contents
Returns
void|object

Definition at line 523 of file DBMssql.class.php.

DBMssql::createTableByXmlFile (   $file_name)

Creates a table by using xml file path

Parameters
string$file_namexml schema file path
Returns
void|object

Definition at line 533 of file DBMssql.class.php.

DBMssql::dropColumn (   $table_name,
  $column_name 
)

Drop a column from the table

Parameters
string$table_nametable name
string$column_namecolumn name
Returns
void

Definition at line 420 of file DBMssql.class.php.

DBMssql::dropIndex (   $table_name,
  $index_name,
  $is_unique = false 
)

Drop an index from the table

Parameters
string$table_nametable name
string$index_nameindex name
boolean$is_unique
Returns
void

Definition at line 484 of file DBMssql.class.php.

DBMssql::getNextSequence ( )

Return the sequence value incremented by 1 Auto_increment column only used in the sequence table

Returns
int

Definition at line 339 of file DBMssql.class.php.

DBMssql::getParser (   $force = FALSE)

Return the DBParser

Parameters
boolean$force
Returns
DBParser

Definition at line 874 of file DBMssql.class.php.

DBMssql::getSelectSql (   $query,
  $with_values = TRUE,
  $connection = NULL 
)

Return select query string

Parameters
object$query
boolean$with_values
Returns
string

Definition at line 733 of file DBMssql.class.php.

DBMssql::getUpdateSql (   $query,
  $with_values = true,
  $with_priority = false 
)

Return update query string

Parameters
object$query
boolean$with_values
boolean$with_priority
Returns
string

Definition at line 682 of file DBMssql.class.php.

DBMssql::isColumnExists (   $table_name,
  $column_name 
)

Check column exist status of the table

Parameters
string$table_nametable name
string$column_namecolumn name
Returns
boolean

Definition at line 436 of file DBMssql.class.php.

DBMssql::isIndexExists (   $table_name,
  $index_name 
)

Check index status of the table

Parameters
string$table_nametable name
string$index_nameindex name
Returns
boolean

Definition at line 500 of file DBMssql.class.php.

DBMssql::isTableExists (   $target_name)

Check a table exists status

Parameters
string$target_name
Returns
boolean

Definition at line 357 of file DBMssql.class.php.

DBMssql::queryError (   $queryObject)

If have a error, return error object

Parameters
BaseObject$queryObject
Returns
BaseObject

Definition at line 884 of file DBMssql.class.php.

DBMssql::queryPageLimit (   $queryObject,
  $result,
  $connection 
)

If select query execute, return page info

Parameters
BaseObject$queryObject
resource$result
resource$connection
Returns
BaseObject BaseObject with page info containing

Definition at line 910 of file DBMssql.class.php.

Member Data Documentation

DBMssql::$column_type
Initial value:
= array(
'bignumber' => 'bigint',
'number' => 'int',
'varchar' => 'nvarchar',
'char' => 'nchar',
'text' => 'ntext',
'bigtext' => 'ntext',
'date' => 'nvarchar(14)',
'float' => 'float',
)

Definition at line 30 of file DBMssql.class.php.

DBMssql::$comment_syntax = '/* %s */'

Definition at line 21 of file DBMssql.class.php.

DBMssql::$param = array()

Definition at line 20 of file DBMssql.class.php.

DBMssql::$prefix = 'xe'

Definition at line 19 of file DBMssql.class.php.


The documentation for this class was generated from the following file: