Autodoc
  • Namespace
  • Class
  • Tree

Namespaces

  • BlueTihi
    • Context
  • Brickrouge
    • Element
      • Nodes
    • Renderer
    • Widget
  • ICanBoogie
    • ActiveRecord
    • AutoConfig
    • CLDR
    • Composer
    • Core
    • Event
    • Exception
    • HTTP
      • Dispatcher
      • Request
    • I18n
      • Translator
    • Mailer
    • Modules
      • Taxonomy
        • Support
      • Thumbnailer
        • Versions
    • Object
    • Operation
      • Dispatcher
    • Prototype
    • Routes
    • Routing
      • Dispatcher
    • Session
  • Icybee
    • ActiveRecord
      • Model
    • ConfigOperation
    • Document
    • EditBlock
    • Element
      • ActionbarContextual
      • ActionbarSearch
      • ActionbarToolbar
    • FormBlock
    • Installer
    • ManageBlock
    • Modules
      • Articles
      • Cache
        • Collection
        • ManageBlock
      • Comments
        • ManageBlock
      • Contents
        • ManageBlock
      • Dashboard
      • Editor
        • Collection
      • Files
        • File
        • ManageBlock
      • Forms
        • Form
        • ManageBlock
      • I18n
      • Images
        • ManageBlock
      • Members
      • Modules
        • ManageBlock
      • Nodes
        • ManageBlock
        • Module
      • Pages
        • BreadcrumbElement
        • LanguagesElement
        • ManageBlock
        • NavigationBranchElement
        • NavigationElement
        • Page
        • PageController
      • Registry
      • Search
      • Seo
      • Sites
        • ManageBlock
      • Taxonomy
        • Terms
          • ManageBlock
        • Vocabulary
          • ManageBlock
      • Users
        • ManageBlock
        • NonceLogin
        • Roles
      • Views
        • ActiveRecordProvider
        • Collection
        • View
    • Operation
      • ActiveRecord
      • Constructor
      • Module
      • Widget
    • Rendering
  • None
  • Patron
  • PHP

Classes

  • ActiveRecordCache
  • CollectDependenciesEvent
  • Connection
  • Connections
  • DateTimePropertySupport
  • Helpers
  • Hooks
  • Model
  • Models
  • Query
  • RunTimeActiveRecordCache
  • Statement
  • Table

Interfaces

  • ActiveRecordCacheInterface

Traits

  • CreatedAtProperty
  • DateTimeProperty
  • UpdatedAtProperty

Exceptions

  • ActiveRecordException
  • ConnectionAlreadyEstablished
  • ConnectionNotDefined
  • ConnectionNotEstablished
  • ModelAlreadyInstantiated
  • ModelNotDefined
  • RecordNotFound
  • ScopeNotDefined
  • StatementInvalid

Functions

  • get_model

Class Connection

A connection to a databse.

PDO
Extended by ICanBoogie\ActiveRecord\Connection
Namespace: ICanBoogie\ActiveRecord
Located at vendor/icanboogie/activerecord/lib/connection.php

Methods summary

public
# __construct( string $dsn, string $username = null, string $password = null, array $options = [] )

Establish a connection to a database.

Establish a connection to a database.

Custom options can be specified using the driver-specific connection options:

  • ICanBoogie\ActiveRecord\Connection::ID: Connection identifier.
  • ICanBoogie\ActiveRecord\Connection::TABLE_NAME_PREFIX: Prefix for the database tables.
  • ICanBoogie\ActiveRecord\Connection::CHARSET and ICanBoogie\ActiveRecord\Connection::COLLATE: Charset and collate used for the connection

to the database, and to create tables.

  • ICanBoogie\ActiveRecord\Connection::TIMEZONE: Timezone for the connection.

Parameters

$dsn
string
$dsn
$username
string
$username
$password
string
$password
$options
array
$options

Link

http://www.php.net/manual/en/pdo.construct.php
http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html

Overrides

PDO::__construct
public mixed
# __invoke( )

Alias to ICanBoogie\ActiveRecord\Connection::exec().

Alias to ICanBoogie\ActiveRecord\Connection::exec().

Returns

mixed
public
# __get( mixed $property )
public Database\Statement
# prepare( string $statement, array $options = [] )

Overrides the method to resolve the statement before it is prepared, then set its fetch mode and connection.

Overrides the method to resolve the statement before it is prepared, then set its fetch mode and connection.

Parameters

$statement
string
$statement Query statement.
$options
array
$options

Returns

Database\Statement
The prepared statement.

Throws

ICanBoogie\ActiveRecord\StatementInvalid
if the statement cannot be prepared.

Overrides

PDO::prepare
public ICanBoogie\ActiveRecord\Statement
# query( mixed $statement, array $args = [], array $options = [] )

Overrides the method in order to prepare (and resolve) the statement and execute it with the specified arguments and options.

Overrides the method in order to prepare (and resolve) the statement and execute it with the specified arguments and options.

Returns

ICanBoogie\ActiveRecord\Statement

Overrides

PDO::query
public
# exec( mixed $statement )

Executes a statement.

Executes a statement.

The statement is resolved using the ICanBoogie\ActiveRecord\Connection::resolve_statement() method before it is executed.

The execution of the statement is wrapped in a try/catch block. PDOException are caught and ICanBoogie\ActiveRecord\StatementInvalid exception are thrown with additional information instead.

Using this method increments the queries_by_connection stat.

Throws

ICanBoogie\ActiveRecord\StatementInvalid
if the statement cannot be executed.

Overrides

PDO::exec
public string|array
# quote_identifier( string|array $identifier )

Places quotes around the identifier.

Places quotes around the identifier.

Parameters

$identifier
string|array
$identifier

Returns

string|array
public string
# resolve_statement( string $statement )

Replaces placeholders with their value.

Replaces placeholders with their value.

The following placeholders are supported:

  • {prefix}: replaced by the ICanBoogie\ActiveRecord\Connection::$table_name_prefix property.
  • {charset}: replaced by the ICanBoogie\ActiveRecord\Connection::$charset property.
  • {collate}: replaced by the ICanBoogie\ActiveRecord\Connection::$collate property.

Parameters

$statement
string
$statement

Returns

string
The resolved statement.
public
# begin( )

Alias for the beginTransaction() method.

Alias for the beginTransaction() method.

See

PDO::beginTransaction()
public array
# parse_schema( array $schema )

Parses a schema to create a schema with low level definitions.

Parses a schema to create a schema with low level definitions.

For example, a column defined as 'serial' is parsed as :

'type' => 'integer', 'serial' => true, 'size' => 'big', 'unsigned' => true, 'primary' => true

Parameters

$schema
array
$schema

Returns

array
public boolean
# create_table( string $unprefixed_name, array $schema )

Creates a table of the specified name and schema.

Creates a table of the specified name and schema.

Parameters

$unprefixed_name
string
$unprefixed_name The unprefixed name of the table.
$schema
array
$schema The schema of the table.

Returns

boolean
public boolean
# table_exists( string $unprefixed_name )

Checks if a specified table exists in the database.

Checks if a specified table exists in the database.

Parameters

$unprefixed_name
string
$unprefixed_name The unprefixed name of the table.

Returns

boolean
true if the table exists, false otherwise.
public
# optimize( )

Optimizes the tables of the database.

Optimizes the tables of the database.

Methods inherited from PDO

__sleep(), __wakeup(), beginTransaction(), commit(), errorCode(), errorInfo(), getAttribute(), getAvailableDrivers(), inTransaction(), lastInsertId(), quote(), rollBack(), setAttribute()

Magic methods summary

Constants summary

string T_ID '#id'
#
string T_TABLE_NAME_PREFIX '#table_name_prefix'
#
string T_CHARSET '#charset'
#
string T_COLLATE '#collate'
#
string T_TIMEZONE '#timezone'
#
string ID '#id'
#
string TABLE_NAME_PREFIX '#table_name_prefix'
#
string CHARSET '#charset'
#
string COLLATE '#collate'
#
string TIMEZONE '#timezone'
#

Constants inherited from PDO

ATTR_AUTOCOMMIT, ATTR_CASE, ATTR_CLIENT_VERSION, ATTR_CONNECTION_STATUS, ATTR_CURSOR, ATTR_CURSOR_NAME, ATTR_DEFAULT_FETCH_MODE, ATTR_DRIVER_NAME, ATTR_EMULATE_PREPARES, ATTR_ERRMODE, ATTR_FETCH_CATALOG_NAMES, ATTR_FETCH_TABLE_NAMES, ATTR_MAX_COLUMN_LEN, ATTR_ORACLE_NULLS, ATTR_PERSISTENT, ATTR_PREFETCH, ATTR_SERVER_INFO, ATTR_SERVER_VERSION, ATTR_STATEMENT_CLASS, ATTR_STRINGIFY_FETCHES, ATTR_TIMEOUT, CASE_LOWER, CASE_NATURAL, CASE_UPPER, CURSOR_FWDONLY, CURSOR_SCROLL, ERRMODE_EXCEPTION, ERRMODE_SILENT, ERRMODE_WARNING, ERR_NONE, FETCH_ASSOC, FETCH_BOTH, FETCH_BOUND, FETCH_CLASS, FETCH_CLASSTYPE, FETCH_COLUMN, FETCH_FUNC, FETCH_GROUP, FETCH_INTO, FETCH_KEY_PAIR, FETCH_LAZY, FETCH_NAMED, FETCH_NUM, FETCH_OBJ, FETCH_ORI_ABS, FETCH_ORI_FIRST, FETCH_ORI_LAST, FETCH_ORI_NEXT, FETCH_ORI_PRIOR, FETCH_ORI_REL, FETCH_PROPS_LATE, FETCH_SERIALIZE, FETCH_UNIQUE, MYSQL_ATTR_COMPRESS, MYSQL_ATTR_DIRECT_QUERY, MYSQL_ATTR_FOUND_ROWS, MYSQL_ATTR_IGNORE_SPACE, MYSQL_ATTR_INIT_COMMAND, MYSQL_ATTR_LOCAL_INFILE, MYSQL_ATTR_MAX_BUFFER_SIZE, MYSQL_ATTR_READ_DEFAULT_FILE, MYSQL_ATTR_READ_DEFAULT_GROUP, MYSQL_ATTR_SSL_CA, MYSQL_ATTR_SSL_CAPATH, MYSQL_ATTR_SSL_CERT, MYSQL_ATTR_SSL_CIPHER, MYSQL_ATTR_SSL_KEY, MYSQL_ATTR_USE_BUFFERED_QUERY, NULL_EMPTY_STRING, NULL_NATURAL, NULL_TO_STRING, PARAM_BOOL, PARAM_EVT_ALLOC, PARAM_EVT_EXEC_POST, PARAM_EVT_EXEC_PRE, PARAM_EVT_FETCH_POST, PARAM_EVT_FETCH_PRE, PARAM_EVT_FREE, PARAM_EVT_NORMALIZE, PARAM_INPUT_OUTPUT, PARAM_INT, PARAM_LOB, PARAM_NULL, PARAM_STMT, PARAM_STR, PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT, PGSQL_TRANSACTION_ACTIVE, PGSQL_TRANSACTION_IDLE, PGSQL_TRANSACTION_INERROR, PGSQL_TRANSACTION_INTRANS, PGSQL_TRANSACTION_UNKNOWN

Properties summary

protected string $id
#

Connection identifier.

Connection identifier.

protected string $table_name_prefix
#

Prefix to prepend to every table name.

Prefix to prepend to every table name.

So if set to "dev", all table names will be named like "dev_nodes", "dev_contents", etc. This is a convenient way of creating a namespace for tables in a shared database. By default, the prefix is the empty string.

protected string $charset
#

Charset for the connection. Also used to specify the charset while creating tables.

Charset for the connection. Also used to specify the charset while creating tables.

protected string $collate
#

Used to specify the collate while creating tables.

Used to specify the collate while creating tables.

protected string $driver_name
#

Driver name for the connection.

Driver name for the connection.

public integer $queries_count
#

The number of database queries and executions, used for statistics purpose.

The number of database queries and executions, used for statistics purpose.

public array[]array $profiling
#

The number of micro seconds spent per request.

The number of micro seconds spent per request.

Magic properties

public read-only string $charset
#

The character set used to communicate with the database. Defaults to "utf8".

The character set used to communicate with the database. Defaults to "utf8".

public read-only string $collate
#

The collation of the character set. Defaults to "utf8_general_ci".

The collation of the character set. Defaults to "utf8_general_ci".

public read-only string $driver_name
#

Name of the PDO driver.

Name of the PDO driver.

public read-only string $id
#

Identifier of the database connection.

Identifier of the database connection.

public read-only string $table_name_prefix
#

The prefix to prepend to every table name.

The prefix to prepend to every table name.

Autodoc API documentation generated by ApiGen 2.8.0