LGV_TZ_Lookup 1.4.2
Time zone lookup for PHP applications and HTTP clients
Loading...
Searching...
No Matches
LGV_TZ_Lookup_PDO Class Reference

This class provides a genericized interface to the PHP PDO toolkit. More...

Public Member Functions

 __construct ( $inDatabase, $inUser, $inPassword, $inDriver, $inHost, $inPort)
 Initializes connection param class members.
 preparedRows ($sql, $params=array(), $buffered=true)
 preparedStatement ( $sql, $params=array(), $fetchResponse=false, $paramTypes=array())
 Wrapper for preparing and executing a PDOStatement.

Public Attributes

 $driver_type
 The type of PDO driver we are configured for.
 $last_insert
 This holds the integer ID of the last AUTO_INCREMENT insert.

Private Attributes

 $_pdo
 Internal PDO object.

Detailed Description

© Copyright 2023-2026, The Great Rift Valley Software Company

LICENSE:

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Little Green Viper Software Development LLC

This is a PDO abstraction class, derived from the Badger Hardened Baseline Database Component

This supports MySQL and PostgreSQL, including binary parameters and bounded polygon reads.

Definition at line 32 of file LGV_TZ_Lookup_PDO.class.php.

Constructor & Destructor Documentation

◆ __construct()

LGV_TZ_Lookup_PDO::__construct ( $inDatabase,
$inUser,
$inPassword,
$inDriver,
$inHost,
$inPort )

Must be called BEFORE any attempts to connect to or query a database. This uses UTF8, as the charset.

Will destroy previous connection (if one exists).

Parameters
$inDatabasedatabase name
$inUserdatabase user
$inPassworddatabase password
$inDriverdatabase server type
$inHostdatabase server host
$inPortdatabase TCP port

Definition at line 49 of file LGV_TZ_Lookup_PDO.class.php.

References $dsn, and driver_type.

Member Function Documentation

◆ preparedRows()

LGV_TZ_Lookup_PDO::preparedRows ( $sql,
$params = array(),
$buffered = true )

Yield rows one at a time and release the cursor, including when a lookup returns before consuming every row. Polygon reads can disable MySQL buffering to avoid retaining every candidate blob. An unbuffered reader must be closed before another query; the finally block drains its cursor and restores the connection mode. PostgreSQL uses single-row fetching on PHP 8.5+, or a server cursor on earlier PHP releases. BYTEA streams are read and closed here, so callers receive the same binary strings on either database.

Definition at line 153 of file LGV_TZ_Lookup_PDO.class.php.

References $options, and driver_type.

Referenced by preparedStatement().

Here is the caller graph for this function:

◆ preparedStatement()

LGV_TZ_Lookup_PDO::preparedStatement ( $sql,
$params = array(),
$fetchResponse = false,
$paramTypes = array() )
Exceptions
Exceptionthrown if internal PDO exception is thrown
Returns
true if execution is successful (and fetchResponse is false), or an array of associative arrays of results, if fetchResponse is true.
Parameters
$sqlSQL statement to send (with question mark placeholders).
$paramsData for the placeholders. Default is an empty array.
$fetchResponseIf true (default is false), then a fetch will be done, and a response returned.
$paramTypesOptional zero-based PDO parameter types for positional write parameters.

Definition at line 89 of file LGV_TZ_Lookup_PDO.class.php.

References driver_type, and preparedRows().

Here is the call graph for this function:

Member Data Documentation

◆ $_pdo

LGV_TZ_Lookup_PDO::$_pdo
private

Definition at line 34 of file LGV_TZ_Lookup_PDO.class.php.

◆ $driver_type

LGV_TZ_Lookup_PDO::$driver_type

Definition at line 36 of file LGV_TZ_Lookup_PDO.class.php.

◆ $last_insert

LGV_TZ_Lookup_PDO::$last_insert

Definition at line 38 of file LGV_TZ_Lookup_PDO.class.php.


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