xplo.re Medusa Core Framework 3.1
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Event
  • Todo
  • Download

Namespaces

  • Core
    • Authentication
      • Auto
        • Driver
      • Driver
    • Cache
      • Driver
    • Charset
      • Driver
    • Configuration
    • Controller
    • Converter
      • Driver
    • Decoder
      • Driver
    • Encoder
      • Driver
    • Env
      • Authentication
      • Locale
      • Proxy
      • Server
        • HTTP
        • Redirect
        • X
    • Exception
    • Exchange
      • Driver
    • Field
    • Filter
      • Driver
    • Formatter
      • Driver
        • coreuimarkup
          • Token
    • Hash
    • Loader
    • Locale
    • Log
      • Driver
    • Module
      • Dependency
        • Requirement
          • Core
          • PHP
      • Linkage
        • Driver
    • PDF
    • Plugin
    • Query
      • Driver
    • Server
      • Driver
    • Session
      • Driver
    • Set
    • Storage
      • Driver
      • Field
        • Element
    • Stream
      • Driver
    • String
    • Translation
      • Driver
      • Language
        • Driver
    • URI
      • Driver
    • Version
    • View
      • Driver
        • coreui
          • Control
            • Button
            • Table
          • Element
        • htmlbuilder
          • Tags
        • yui
          • Modules
  • None
  • PHP

Classes

  • Authentication
  • Authentication_Token
  • Autoloader
  • Cache
  • Charset
  • ClassDescriptor
  • Closure
  • Controller
  • Converter
  • Date
  • Decoder
  • Delegate
  • Dispatcher
  • Encoder
  • Env
  • Env_Field
  • Env_File
  • Env_FileList
  • Env_Request
  • Env_SERVER
  • Exchange
  • Fault
  • Field
  • Filter
  • Filter_Value
  • Formatter
  • Hash
  • IP
  • Loader
  • Locale
  • Locale_Iterator
  • Locale_Node
  • Log
  • Module
  • Module_Iterator
  • Nothing
  • Object
  • OS
  • Plugin
  • Profiler
  • Query
  • Registry
  • Resource
  • Server
  • Session
  • Session_Token
  • Set
  • Storage
  • Storage_Result
  • Storage_Statement
  • Stream
  • String
  • Translation
  • URI
  • URI_Parameters
  • UUID
  • Value
  • Version
  • View

Interfaces

  • Accessor
  • Chainable
  • Comparable
  • Configurable
  • Equality
  • Identity
  • Inquiry
  • Masquerade
  • Mutator
  • SeekableStream
  • Storable
  • Variator

Exceptions

  • Exception

Constants

  • Copyright
  • ProductName
  • UseVersion
  • Version

Functions

  • ns_expand
  • ns_file_exists
  • ns_get_version
  • ns_resolve

Class Storage_Statement

Base class for prepared storage query statements.

Core\Object implements Core\Chainable
Extended by Core\Set implements Core\Accessor
Extended by Core\Storage_Statement

Direct known subclasses

Core\Storage\SQL_Statement

Indirect known subclasses

Core\Storage\Driver\mysql_Statement, Core\Storage\Driver\odbc_Statement, Core\Storage\Driver\sqlite2_Statement, Core\Storage\Driver\sqlite3_Statement

Abstract
Namespace: Core
Package: Core\Storage
Since: 3.0
Requires: PHP 5.3
Version: 1.1
Located at Storage.inc.php

Methods summary

public
# __construct( Core\Storage $driver, Core\Storage\Accessor_Node $query )

Internal method to initialise a new prepared storage statement.

Internal method to initialise a new prepared storage statement.

Parameters

$driver

Reference to the specific storage driver interface for the prepared statement.

$query
Accessor node to transform into storage-specific query statement.

Since

3.0
public string
# __toString( )

Formats the statement type class name including the query string. Useful for debug output.

Formats the statement type class name including the query string. Useful for debug output.

Returns

string
String containing statement type class and query string.

Since

3.0

Overrides

Core\Object::__toString
protected string
# _bind( string $name, mixed $value = null )

Establishes private binding and returns »?«, the standard marker for parameters. Storage engines that use different markers should overwrite this method and call the parent method to establish bindings but return a different marker.

Establishes private binding and returns »?«, the standard marker for parameters. Storage engines that use different markers should overwrite this method and call the parent method to establish bindings but return a different marker.

Parameters

$name
Name of parameter to bind.
$value
Value to bind.

Returns

string
Bound parameter indicator.

Since

3.1
protected string
# _transform( $node )

Accessor transformation hub. Transforms a given accessor node into the driver-specific format by calling transformation methods for each accessor node recursively.

Accessor transformation hub. Transforms a given accessor node into the driver-specific format by calling transformation methods for each accessor node recursively.

Parameters

$node
node to transform.

Returns

string
Transformed query statement data specific to the current driver.

Throws

Core\Exception\Storage
Encountered an accessor node class that is not supported by the driver.

Since

3.0
protected string
# _transform_Boolean( boolean $value )

Default transformation for Boolean values.

Default transformation for Boolean values.

Parameters

$value
Boolean value to transform.

Returns

string
Returns the string »0«, if value is false, otherwise »1«.

Since

3.0
protected string
# _transform_Core_Storage_Accessor_Parameter( Core\Storage\Accessor_Parameter $parameter )

Registers a dynamic binding for the parameter provided.

Registers a dynamic binding for the parameter provided.

Parameters

$parameter
Parameter object to transform.

Returns

string
Binding indicator.

Since

3.1
protected string
# _transform_Float( float $value )

Default transformation for floating point values.

Default transformation for floating point values.

Parameters

$value
Decimal number to transform.

Returns

string
Returns the default C-style to-string conversion of the value.

Since

3.0
protected string
# _transform_Identifier( string $name )

Escapes identifiers as required by the storage back-end.

Escapes identifiers as required by the storage back-end.

Parameters

$name
Identifier to escape.

Returns

string
Escaped identifier string.

Remark

The default implementation uses SQL'92 identifiers. Drivers should implement the corresponding syntax required by their back-end.


Since

3.0
protected string
# _transform_Integer( integer $value )

Default transformation for integer values.

Default transformation for integer values.

Parameters

$value
Scalar integer number to transform.

Returns

string
Returns the default PHP to-string conversion of the value.

Since

3.0
protected string
# _transform_Storable( Core\Storable $object )

Default transformation for objects implementing the Core\Storable interface.

Default transformation for objects implementing the Core\Storable interface.

Parameters

$object
Storable object to transform.

Returns

string
Returns the packed variant from the Core\Storable object.

Since

3.1
protected string
# _transform_String( string $string )

Default transformation for strings.

Default transformation for strings.

Parameters

$string
String to transform.

Returns

string
Returns the string verbatim.

Since

3.0
public Core\Storage_Result
# execute( array $parameters = null )

Executes the prepared statement of the current instance.

Executes the prepared statement of the current instance.

Parameters

$parameters

Optional. Associative key-value arguments array for execution control passed on to the driver Storage::execute() method.

Returns

Core\Storage_Result
Storage result set on success, otherwise an exception is thrown.

Since

3.0
public array
# mergeParameters( array $parameters = null )

Merges internal parameters sets with external sets. If no external set is given, external parameters are initialised with null.

Merges internal parameters sets with external sets. If no external set is given, external parameters are initialised with null.

Parameters

$parameters
Parameters array to merge into internal parameters array.

Returns

array
Bindings array.

Throws

Core\Exception\InvalidArgument
Argument key contains an unknown parameter name.

Since

3.1

Methods inherited from Core\Set

__get(), __isset()

Methods inherited from Core\Object

__autocreateFactory(), __call(), __processParameters(), attachMethod(), chain(), getValueForKey(), getValueForKeyPath(), getValueForUndefinedKey(), hash(), issetValueForKey(), setValueForKey(), setValueForKeyPath(), setValueForUndefinedKey(), uuid()

Constants summary

Constants inherited from Core\Object

AnyParameterType, AutochainParameterType, AutocreateParameterType, BooleanParameterType, CharParameterType, EnumParameterType, IntegerParameterType, RealParameterType, StringParameterType, UserParameterType

Properties summary

protected mixed[] $_v_bindings

Array of bound parameter values (in the order they were bound).

Array of bound parameter values (in the order they were bound).

Since

3.1
#
protected int[] $_v_bindingParameters

Associative array of parameter names as keys and their corresponding index in the bindings array as the value.

Associative array of parameter names as keys and their corresponding index in the bindings array as the value.

Since

3.1
#
protected Core\Storage $_v_driver

Reference to the storage driver interface for the prepared statement.

Reference to the storage driver interface for the prepared statement.

Since

3.0
#
protected integer $_v_insertID

Cached insert ID of last statement execution. Only valid for insert statements.

Cached insert ID of last statement execution. Only valid for insert statements.

Since

3.0
#
protected string $_v_query

Prepared storage-specific raw query.

Prepared storage-specific raw query.

Since

3.0
#

Magic properties

public read-only Core\Storage $driver

Associated storage driver.

public read-only integer $insertID

Cached insert ID of last statement execution (if statement is an insertion).

public read-only mixed $query

Driver-specific representation of prepared statement.

Magic properties inherited from Core\Object

$hash, $uuid

xplo.re Medusa Core Framework 3.1 API documentation generated by ApiGen