DboMssql Class Reference

Inheritance diagram for DboMssql:

DboSource DataSource Object

List of all members.


Public Member Functions

 _execute ($sql)
 buildColumn ($column)
 buildIndex ($indexes, $table=null)
 column ($real)
 connect ()
 create (&$model, $fields=null, $values=null)
 describe (&$model)
 disconnect ()
 fetchResult ()
 fields (&$model, $alias=null, $fields=array(), $quote=true)
 lastAffected ()
 lastError ()
 lastInsertId ($source=null)
 lastNumRows ()
 limit ($limit, $offset=null)
 listSources ()
 read (&$model, $queryData=array(), $recursive=null)
 renderStatement ($type, $data)
 resultSet (&$results)
 update (&$model, $fields=array(), $values=null, $conditions=null)
 value ($data, $column=null, $safe=false)

Public Attributes

 $_baseConfig
 $_commands
 $columns
 $description = "MS SQL DBO Driver"
 $endQuote = "]"
 $startQuote = "["

Detailed Description

Definition at line 38 of file dbo_mssql.php.


Member Function Documentation

DboMssql::_execute ( sql  ) 

Executes given SQL statement.

Parameters:
string $sql SQL statement
Returns:
resource Result resource identifier protected

Definition at line 175 of file dbo_mssql.php.

Referenced by connect(), and create().

DboMssql::buildColumn ( column  ) 

Generate a database-native column schema string

Parameters:
array $column An array structured like the following: array('name'=>'value', 'type'=>'value'[, options]), where options can be 'default', 'length', or 'key'.
Returns:
string

Reimplemented from DboSource.

Definition at line 646 of file dbo_mssql.php.

References DboSource::name().

DboMssql::buildIndex ( indexes,
table = null 
)

Format indexes for create table

Parameters:
array $indexes
string $table
Returns:
string

Reimplemented from DboSource.

Definition at line 666 of file dbo_mssql.php.

References $out, column(), and DboSource::name().

DboMssql::column ( real  ) 

Converts database-layer column types to basic types

Parameters:
string $real Real database-layer column type (i.e. "varchar(255)")
Returns:
string Abstract column type (i.e. "string")

Reimplemented from DataSource.

Definition at line 457 of file dbo_mssql.php.

References limit(), and DboSource::name().

Referenced by buildIndex(), and describe().

DboMssql::connect (  ) 

Connects to the database using options in the given configuration array.

Returns:
boolean True if the database could be connected, else false

Definition at line 127 of file dbo_mssql.php.

References DataSource::$config, _execute(), config(), and env().

DboMssql::create ( &$  model,
fields = null,
values = null 
)

Generates and executes an SQL INSERT statement for given model, fields, and values. Removes Identity (primary key) column from update data before returning to parent, if value is empty.

Parameters:
Model $model
array $fields
array $values
mixed $conditions
Returns:
array

Reimplemented from DboSource.

Definition at line 343 of file dbo_mssql.php.

References _execute(), and DboSource::fullTableName().

DboMssql::describe ( &$  model  ) 

Returns an array of the fields in given table name.

Parameters:
Model $model Model object to describe
Returns:
array Fields in table. Keys are name and type

Definition at line 210 of file dbo_mssql.php.

References column(), DboSource::fetchAll(), DboSource::fullTableName(), DboSource::length(), and value().

DboMssql::disconnect (  ) 

Disconnects from database.

Returns:
boolean True if the database could be disconnected, else false

Definition at line 163 of file dbo_mssql.php.

DboMssql::fetchResult (  ) 

Fetches the next row from the current result set

Returns:
unknown

Definition at line 624 of file dbo_mssql.php.

References DboSource::$index.

DboMssql::fields ( &$  model,
alias = null,
fields = array(),
quote = true 
)

Generates the fields list of an SQL query.

Parameters:
Model $model
string $alias Alias tablename
mixed $fields
Returns:
array

Reimplemented from DboSource.

Definition at line 294 of file dbo_mssql.php.

References DboSource::$alias, and DboSource::name().

DboMssql::lastAffected (  ) 

Returns number of affected rows in previous database operation. If no previous operation exists, this returns false.

Returns:
integer Number of affected rows

Definition at line 402 of file dbo_mssql.php.

DboMssql::lastError (  ) 

Returns a formatted error message from previous database operation.

Returns:
string Error message with error number

Definition at line 386 of file dbo_mssql.php.

References DataSource::$error.

DboMssql::lastInsertId ( source = null  ) 

Returns the ID generated from the previous INSERT operation.

Parameters:
unknown_type $source
Returns:
in

Reimplemented from DataSource.

Definition at line 426 of file dbo_mssql.php.

References DboSource::fetchRow().

DboMssql::lastNumRows (  ) 

Returns number of rows in previous resultset. If no previous resultset exists, this returns false.

Returns:
integer Number of rows in resultset

Definition at line 414 of file dbo_mssql.php.

DboMssql::limit ( limit,
offset = null 
)

Returns a limit statement in the correct format for the particular database.

Parameters:
integer $limit Limit of results returned
integer $offset Offset from which to start results
Returns:
string SQL limit/offset statement

Reimplemented from DboSource.

Definition at line 437 of file dbo_mssql.php.

Referenced by column().

DboMssql::listSources (  ) 

Returns an array of sources (tables) in the database.

Returns:
array Array of tablenames in the database

Definition at line 183 of file dbo_mssql.php.

References DboSource::fetchAll().

DboMssql::read ( &$  model,
queryData = array(),
recursive = null 
)

Returns an array of all result rows for a given SQL query. Returns false if no rows matched.

Parameters:
string $sql SQL statement
boolean $cache Enables returning/storing cached query results
Returns:
array Array of resultset rows, or false if no rows matched

Reimplemented from DboSource.

Definition at line 613 of file dbo_mssql.php.

DboMssql::renderStatement ( type,
data 
)

Builds final SQL statement

Parameters:
string $type Query type
array $data Query data
Returns:
string

Reimplemented from DboSource.

Definition at line 532 of file dbo_mssql.php.

References DboSource::$index.

DboMssql::resultSet ( &$  results  ) 

Enter description here...

Parameters:
unknown_type $results

Definition at line 500 of file dbo_mssql.php.

References DboSource::$index.

DboMssql::update ( &$  model,
fields = array(),
values = null,
conditions = null 
)

Generates and executes an SQL UPDATE statement for given model, fields, and values. Removes Identity (primary key) column from update data before returning to parent.

Parameters:
Model $model
array $fields
array $values
mixed $conditions
Returns:
array

Reimplemented from DboSource.

Definition at line 372 of file dbo_mssql.php.

DboMssql::value ( data,
column = null,
safe = false 
)

Returns a quoted and escaped string of $data for use in an SQL statement.

Parameters:
string $data String to be prepared for use in an SQL statement
string $column The column into which this data will be inserted
boolean $safe Whether or not numeric data should be handled automagically if no column data is provided
Returns:
string Quoted and escaped data

Definition at line 255 of file dbo_mssql.php.

References DboSource::boolean().

Referenced by describe().


Member Data Documentation

DboMssql::$_baseConfig

Initial value:

 array(
        'persistent' => true,
        'host' => 'localhost',
        'login' => 'root',
        'password' => '',
        'database' => 'cake',
        'port' => '1433',
    )

Reimplemented from DataSource.

Definition at line 69 of file dbo_mssql.php.

DboMssql::$_commands

Initial value:

 array(
        'begin'    => 'BEGIN TRANSACTION',
        'commit'   => 'COMMIT',
        'rollback' => 'ROLLBACK'
    )

Reimplemented from DboSource.

Definition at line 101 of file dbo_mssql.php.

DboMssql::$columns

Initial value:

 array(
        'primary_key' => array('name' => 'IDENTITY (1, 1) NOT NULL'),
        'string'    => array('name' => 'varchar', 'limit' => '255'),
        'text'      => array('name' => 'text'),
        'integer'   => array('name' => 'int', 'formatter' => 'intval'),
        'float'     => array('name' => 'numeric', 'formatter' => 'floatval'),
        'datetime'  => array('name' => 'datetime', 'format' => 'Y-m-d H:i:s', 'formatter' => 'date'),
        'timestamp' => array('name' => 'timestamp', 'format' => 'Y-m-d H:i:s', 'formatter' => 'date'),
        'time'      => array('name' => 'datetime', 'format' => 'H:i:s', 'formatter' => 'date'),
        'date'      => array('name' => 'datetime', 'format' => 'Y-m-d', 'formatter' => 'date'),
        'binary'    => array('name' => 'image'),
        'boolean'   => array('name' => 'bit')
    )

Definition at line 82 of file dbo_mssql.php.

DboMssql::$description = "MS SQL DBO Driver"

Reimplemented from DboSource.

Definition at line 44 of file dbo_mssql.php.

DboMssql::$endQuote = "]"

Reimplemented from DboSource.

Definition at line 56 of file dbo_mssql.php.

DboMssql::$startQuote = "["

Reimplemented from DboSource.

Definition at line 50 of file dbo_mssql.php.


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