eZPublishCommunityProject(LegacyStack)  2013.6
eZPostgreSQLDB Class Reference

The eZPostgreSQLDB class provides PostgreSQL database functions. More...

+ Inheritance diagram for eZPostgreSQLDB:
+ Collaboration diagram for eZPostgreSQLDB:

Public Member Functions

 arrayQuery ($sql, $params=array(), $server=false)
 
 availableDatabases ()
 
 beginQuery ()
 
 bindingType ()
 
 bindVariable ($value, $fieldDef=false)
 
 close ()
 
 commitQuery ()
 
 concatString ($strings=array())
 
 correctSequenceValues ()
 
 createDatabase ($dbName)
 
 databaseName ()
 
 databaseServerVersion ()
 
 escapeString ($str)
 
 eZPostgreSQLDB ($parameters)
 
 eZTableList ($server=eZDBInterface::SERVER_MASTER)
 
 isCharsetSupported ($charset)
 
 lastSerialID ($table=false, $column= 'id')
 Returns the last serial ID generated with an auto increment field. More...
 
 lock ($table)
 
 md5 ($str)
 
 query ($sql, $server=false)
 
 relationCount ($relationType=eZDBInterface::RELATION_TABLE)
 
 relationCounts ($relationMask)
 
 relationList ($relationType=eZDBInterface::RELATION_TABLE)
 
 relationMatchRegexp ($relationType)
 
 removeDatabase ($dbName)
 
 removeRelation ($relationName, $relationType)
 
 rollbackQuery ()
 
 setError ()
 
 supportedRelationTypeMask ()
 
 supportedRelationTypes ()
 
 unlock ()
 
- Public Member Functions inherited from eZDBInterface
 arrayQuery ($sql, $params=array(), $server=false)
 Executes an SQL query and returns the result as an array of accociative arrays. More...
 
 attribute ($name)
 Returns the value of the attribute $name if it exists, otherwise null. More...
 
 attributes ()
 Returns the available attributes for this database handler. More...
 
 availableDatabases ()
 Returns an array of available databases in the database, null of none available, false if listing databases not supported by database. More...
 
 begin ()
 Begin a new transaction. More...
 
 beginQuery ()
 The query to start a transaction. More...
 
 bindingType ()
 Returns type of binding used in database plugin. More...
 
 bindVariable ($value, $fieldDef=false)
 Binds variable. More...
 
 bitAnd ($arg1, $arg2)
 Returns a sql-expression(string) to generate a bit and of the argument. More...
 
 bitOr ($arg1, $arg2)
 Returns a sql-expression(string) to generate a bit and of the argument. More...
 
 charset ()
 Returns the charset which the database is encoded in. More...
 
 checkCharset ($charset, &$currentCharset)
 Checks if the requested character set matches the one used in the database. More...
 
 close ()
 Will close the database connection. More...
 
 commit ()
 Commits the current transaction. More...
 
 commitQuery ()
 The query to commit the transaction. More...
 
 concatString ($strings=array())
 Returns a sql-expression(string) to concatenate strings. More...
 
 connectRetryCount ()
 Returns the number of times the db handler should try to reconnect if it fails. More...
 
 connectRetryWaitTime ()
 Returns the number of seconds the db handler should wait before rereconnecting. More...
 
 createDatabase ($dbName)
 Create a new database. More...
 
 createTempTable ($createTableQuery= '', $server=self::SERVER_SLAVE)
 Create a new temporary table. More...
 
 databaseClientVersion ()
 Returns the version of the database client or false if no version could be retrieved/. More...
 
 databaseName ()
 Returns the name of driver, this is used to determine the name of the database type. More...
 
 databaseServerVersion ()
 Returns the version of the database server or false if no version could be retrieved/. More...
 
 dropTempTable ($dropTableQuery= '', $server=self::SERVER_SLAVE)
 Drop temporary table. More...
 
 dropTempTableList ($tableList, $server=self::SERVER_SLAVE)
 Drop temporary table list. More...
 
 endTime ()
 Returns the micro time when the timer was ended or false if no timer. More...
 
 endTimer ()
 Stops the current timer and calculates the time taken. More...
 
 errorMessage ()
 Returns the error message. More...
 
 errorNumber ()
 Returns the error number. More...
 
 escapeString ($str)
 Will escape a string so it's ready to be inserted in the database. More...
 
 eZDBInterface ($parameters)
 Creates a new eZDBInterface object and connects to the database backend. More...
 
 eZTableList ($server=self::SERVER_MASTER)
 Returns the existing ez publish tables in database. More...
 
 generateFailedTransactionStack ()
 Goes through the transaction stack tree {. More...
 
 generateFailedTransactionStackEntry ($stack, $indentCount)
 Recursive helper function for generating stack tree output. More...
 
 generateSQLINStatement ($elements, $columnName= '', $not=false, $unique=true, $type=false)
 This function can be used to create a SQL IN statement to be used in a WHERE clause: More...
 
 generateTraceEntry ($entry)
 Helper function for generating output for one stack-trace entry. More...
 
 generateUniqueTempTableName ($pattern, $randomizeIndex=false, $server=self::SERVER_SLAVE)
 Generate unique table name basing on the given pattern. More...
 
 hasAttribute ($name)
 Returns true if the attribute $name exists for this database handler. More...
 
 hasRequiredServerVersion ($minVersion, $name=false)
 Checks if the version number of the server is equal or larger than $minVersion. More...
 
 implodeWithTypeCast ($glue, &$pieces, $type)
 Casts elements of $pieces to type $type and returns them as string separated by $glue. More...
 
 insertFile ($path, $sqlFile, $usePathType=true)
 Inserts the SQL file $sqlFile found in the path $path into the currently connected database. More...
 
 invalidateTransaction ()
 Invalidates the current transaction, see {. More...
 
 isCharsetSupported ($charset)
 Returns true if the charset $charset is supported by the connected database. More...
 
 isConnected ()
 Returns true if we're connected to the database backend. More...
 
 isTransactionValid ()
 Returns if the current or last running transaction is valid. More...
 
 lastSerialID ($table=false, $column=false)
 Returns the last serial ID generated with an auto increment field. More...
 
 lock ($table)
 Locks one or several tables. More...
 
 md5 ($str)
 Returns a sql-expression(string) to generate a md5 sum of the string. More...
 
 prepareSqlQuery (&$fd, &$buffer)
 Prepare the sql file so we can create the database. More...
 
 query ($sql, $server=false)
 Execute a query on the global MySQL database link. More...
 
 relationCount ($relationType=eZDBInterface::RELATION_TABLE)
 Returns the number of relation objects in the database for the relation type $relationType. More...
 
 relationCounts ($relationMask)
 Returns the relation count for all relation types in the mask $relationMask. More...
 
 relationList ($relationType=eZDBInterface::RELATION_TABLE)
 Returns the relation names in the database as an array for the relation type $relationType. More...
 
 relationMatchRegexp ($relationType)
 Return A regexp (PCRE) that can be used to filter out certain relation elements. More...
 
 relationName ($relationType)
 Returns the name of the relation type which is usable in SQL or false if unknown type. More...
 
 removeDatabase ($dbName)
 Removes a database. More...
 
 removeRelation ($relationName, $relationType)
 Tries to remove the relation type $relationType named $relationName. More...
 
 reportError ()
 This is called whenever an error occurs in one of the database handlers. More...
 
 reportQuery ($class, $sql, $numRows, $timeTaken, $asDebug=false)
 Writes a debug notice with query information. More...
 
 rollback ()
 Cancels the transaction. More...
 
 rollbackQuery ()
 The query to cancel the transaction. More...
 
 setError ()
 Sets the error message and error message number. More...
 
 setErrorHandling ($errorHandling)
 Sets the eZDB error handling mode. More...
 
 setIsSQLOutputEnabled ($enabled)
 Enabled or disables sql output. More...
 
 socketPath ()
 Returns the socket path for the database or false if no socket path was defined. More...
 
 startTime ()
 Returns the micro time when the timer was start or false if no timer. More...
 
 startTimer ()
 Records the current micro time. More...
 
 subString ($string, $from, $len=null)
 Returns a sql-expression(string) to get substring. More...
 
 supportedRelationTypeMask ()
 Returns a mask of the relation type it supports. More...
 
 supportedRelationTypes ()
 Returns an array of the relation types. More...
 
 supportsDefaultValuesInsertion ()
 Returns true if the database handler support the insertion of default values, false if not. More...
 
 timeTaken ()
 Returns the number of milliseconds the last operation took or false if no value. More...
 
 transactionCounter ()
 Returns the current transaction counter. More...
 
 unlock ()
 Releases table locks. More...
 
 usesBuiltinEncoding ()
 Returns true if the database handles encoding itself. More...
 
 useShortNames ()
 Returns if the short column names should be used insted of default ones. More...
 
 version ()
 Get database version number. More...
 

Static Public Member Functions

static connectString ($server=null, $port=null, $db=null, $user=null, $password=null)
 

Private Member Functions

 relationKind ($relationType)
 
 subString ($string, $from, $len=null)
 

Additional Inherited Members

- Public Attributes inherited from eZDBInterface
 $Charset
 
 $ConnectRetries
 
 $DB
 
 $DBConnection
 
 $DBWriteConnection
 
 $EndTime
 
 $ErrorMessage
 
 $ErrorNumber = 0
 
 $InputTextCodec
 
 $IsConnected = false
 
 $NumQueries = 0
 
 $OutputSQL
 
 $OutputTextCodec
 
 $Password
 
 $Port
 
 $RecordError = true
 
 $Server
 
 $SlaveDB
 
 $SlavePassword
 
 $SlavePort
 
 $SlaveServer
 
 $SlaveUser
 
 $SocketPath
 
 $StartTime
 
 $TimeTaken
 
 $TransactionCounter
 
 $TransactionIsValid
 
 $TransactionStackTree
 
 $UseBuiltinEncoding
 
 $UsePersistentConnection = false
 
 $User
 
 $UseSlaveServer
 
const BINDING_NAME = 1
 
const BINDING_NO = 0
 
const BINDING_ORDERED = 2
 
const ERROR_MISSING_EXTENSION = 1
 
const RELATION_INDEX = 4
 
const RELATION_INDEX_BIT = 16
 
const RELATION_MASK = 31
 
const RELATION_NONE = 0
 
const RELATION_SEQUENCE = 1
 
const RELATION_SEQUENCE_BIT = 2
 
const RELATION_TABLE = 0
 
const RELATION_TABLE_BIT = 1
 
const RELATION_TRIGGER = 2
 
const RELATION_TRIGGER_BIT = 4
 
const RELATION_VIEW = 3
 
const RELATION_VIEW_BIT = 8
 
const SERVER_MASTER = 1
 
const SERVER_SLAVE = 2
 
- Protected Attributes inherited from eZDBInterface
 $errorHandling = eZDB::ERROR_HANDLING_STANDARD
 

Detailed Description

The eZPostgreSQLDB class provides PostgreSQL database functions.

eZPostgreSQLDB implementes PostgreSQLDB specific database code.

See Also
eZDB

Member Function Documentation

eZPostgreSQLDB::arrayQuery (   $sql,
  $params = array(),
  $server = false 
)
eZPostgreSQLDB::availableDatabases ( )
eZPostgreSQLDB::beginQuery ( )

The query to start the transaction.

eZPostgreSQLDB::bindingType ( )
eZPostgreSQLDB::bindVariable (   $value,
  $fieldDef = false 
)
eZPostgreSQLDB::close ( )
eZPostgreSQLDB::commitQuery ( )

The query to commit the transaction.

eZPostgreSQLDB::concatString (   $strings = array())
static eZPostgreSQLDB::connectString (   $server = null,
  $port = null,
  $db = null,
  $user = null,
  $password = null 
)
static
eZPostgreSQLDB::correctSequenceValues ( )

Sets PostgreSQL sequence values to the maximum values used in the corresponding columns.

eZPostgreSQLDB::createDatabase (   $dbName)
eZPostgreSQLDB::databaseName ( )
eZPostgreSQLDB::databaseServerVersion ( )
eZPostgreSQLDB::escapeString (   $str)
eZPostgreSQLDB::eZPostgreSQLDB (   $parameters)

Creates a new eZPostgreSQLDB object and connects to the database.

eZPostgreSQLDB::eZTableList (   $server = eZDBInterface::SERVER_MASTER)
eZPostgreSQLDB::isCharsetSupported (   $charset)
eZPostgreSQLDB::lastSerialID (   $table = false,
  $column = 'id' 
)

Returns the last serial ID generated with an auto increment field.

In this case that means the current value of the sequence assigned $table

Parameters
string | bool$table
string | bool$column
Returns
int|bool The most recent value for the sequence
eZPostgreSQLDB::lock (   $table)
eZPostgreSQLDB::md5 (   $str)
eZPostgreSQLDB::relationCount (   $relationType = eZDBInterface::RELATION_TABLE)
eZPostgreSQLDB::relationCounts (   $relationMask)
eZPostgreSQLDB::relationKind (   $relationType)
private
eZPostgreSQLDB::relationList (   $relationType = eZDBInterface::RELATION_TABLE)
eZPostgreSQLDB::relationMatchRegexp (   $relationType)
eZPostgreSQLDB::removeDatabase (   $dbName)
eZPostgreSQLDB::removeRelation (   $relationName,
  $relationType 
)
eZPostgreSQLDB::rollbackQuery ( )

The query to cancel the transaction.

eZPostgreSQLDB::setError ( )
eZPostgreSQLDB::subString (   $string,
  $from,
  $len = null 
)
private
eZPostgreSQLDB::supportedRelationTypeMask ( )
eZPostgreSQLDB::supportedRelationTypes ( )

Referenced by relationCounts().

eZPostgreSQLDB::unlock ( )

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