Class Model
This class establishes and maintains a connection to a PDO resource, and provides methods for interacting with that resource
Indirect known subclasses
Accounts,
ApiKeys,
CronTasks,
Currencies,
EmailGroups,
Emails,
Encryption,
GatewayManager,
Invoices,
InvoiceTemplateManager,
Languages,
Logs,
Backup,
Marketplace,
ModuleManager,
Navigation,
PackageGroups,
Packages,
Payments,
Permissions,
PluginManager,
Services,
Settings,
CalendarEvents,
Staff,
StaffGroups,
States,
Taxes,
Test,
Themes,
Transactions,
Upgrades,
Users,
ClientGroups,
Clients,
Companies,
Contacts,
Countries,
Coupons
Methods summary
public
|
#
__construct( array $db_info = null )
Creates a new Model object that establishes a new PDO connection using the given database info, or the default configured info set in the database config file if no info is given |
public
|
|
public
string
|
|
public
|
#
setAttribute( long $attribute, integer $value )
Sets the given value to the given attribute for this connection |
public
|
|
public
|
#
prepare( string $sql, integer $fetch_mode = null )
Prepares an SQL statement to be executed by the PDOStatement::execute() method. Useful when executing the same query with different bound parameters. |
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
|
#
getConnection( )
Returns the connection's PDO object if a connection has been established, null otherwise. |
public
integer
|
|
public static
string
|
|
private
|
#
makeConnection( array $db_info = null )
Establish a new PDO connection using the given array of information. If a connection already exists, no new connection will be created. |
private
|
#
lazyConnect( )
Attempt to connect to the database if lazy connecting is enabled and no connection yet exists |
Magic methods summary
Properties summary
private
array
|
$default_pdo_options |
#
Default PDO attribute settings |
private
object
|
$connection |
#
PDO connection |
private static
array
|
$connections |
#
An array of all database connections established |
private static
array
|
$db_infos |
#
An array of all database connection info (used to find a matching connection) |
private
object
|
$statement |
#
PDO Statement |
private
mixed
|
$fetch_mode |
#
Fetch Mode the PDO:FETCH_* constant (int) to fetch records by, null to use default setting |