Class SparqlEngineDb_Preparator

Description

This class takes care of prepared statements: Preparing them in the database, replacing

Located in /sparql/SparqlEngineDb/Preparator.php (line 12)


	
			
Method Summary
static void replacePrefix ( $strValue,  $arPrefixes)
SparqlEngineDb_Preparator __construct (Query $query,  $dbConn)
array createVariableArray (array $arVariablePositions, array $arVariableValues)
array execute (array $arDbStatements, array $arVariableValues)
array prepareInDb (array $arQueries, array $arPlaceholders)
array replacePlaceholders (string $strQuery, array $arPlaceholders)
void replacePlaceholdersCb ( $matches)
void replacePlaceholdersWithVariables ( $strQuery,  $arPlaceholders,  $arVariableValues)
Methods
static replacePrefix (line 215)
  • access: protected
static void replacePrefix ( $strValue,  $arPrefixes)
  • $strValue
  • $arPrefixes
Constructor __construct (line 17)
  • access: public
SparqlEngineDb_Preparator __construct (Query $query,  $dbConn)
  • Query $query
  • ADOConnection $dbConn
createVariableArray (line 153)

Creates an array full of variables to be passed to the Execute() method of the database connection object.

Uses the variable positions array to get the positions of the variables in the result array, and the variable value array to get the actual values for the prepared statement.

  • return: Array of variable values
  • access: protected
array createVariableArray (array $arVariablePositions, array $arVariableValues)
  • array $arVariablePositions: Positions of the variables as returned by replacePlaceholders().
  • array $arVariableValues: Array of (variable name, value) pairs
execute (line 119)

Executes the given prepared statments, filling the placeholders with the given values.

  • return: Array of database results as returned by Execute()
  • access: public
array execute (array $arDbStatements, array $arVariableValues)
  • array $arDbStatements: Return value of prepareInDb()
  • array $arVariableValues: Array of (variable name, value) pairs
prepareInDb (line 39)

Converts the given queries into sql prepared statments,

calls the prepare command in the database and returns an array consisting of subarrays. They contain the db's prepared statement as first value, and an array of variable positions as second value (key is the position, the sparql variable is the value).

  • return: Array of (prepared statment, variable positions) pairs
  • access: public
array prepareInDb (array $arQueries, array $arPlaceholders)
  • array $arQueries: Array of sql queries part arrays
  • array $arPlaceholders: Array of sparql (variable name => placeholder name) pairs
replacePlaceholders (line 77)

Replaces the placeholders in the given SQL statement with real SQL prepared statements placeholders.

  • return: (prepared sql query string, variable positions) pair
  • access: protected
array replacePlaceholders (string $strQuery, array $arPlaceholders)
  • string $strQuery: SQL query with placeholders
  • array $arPlaceholders: Array of sparql (variable name => placeholder name) pairs
replacePlaceholdersCb (line 95)

Callback method internally used by replacePlaceholders() method.

  • access: protected
void replacePlaceholdersCb ( $matches)
  • $matches
replacePlaceholdersWithVariables (line 178)

Replaces all placeholders with their actual values.

  • access: public
void replacePlaceholdersWithVariables ( $strQuery,  $arPlaceholders,  $arVariableValues)
  • $strQuery
  • $arPlaceholders
  • $arVariableValues
replacePlaceholdersWithVariablesCb (line 198)

Callback method internally used by replacePlaceholdersWithVariables() method.

  • access: protected
void replacePlaceholdersWithVariablesCb ( $matches)
  • $matches

Documentation generated on Fri, 1 Jun 2007 16:50:25 +0200 by phpDocumentor 1.3.2