Zend_Session_SaveHandler_DbTable
category | Zend |
---|---|
package | Zend_Session |
subpackage | SaveHandler |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
inherited_from | \Zend_Db_Table_Abstract |
__construct(\Zend_Config|array $config) : void
$config is an instance of Zend_Config or an array of key/value pairs containing configuration options for Zend_Session_SaveHandler_DbTable and Zend_Db_Table_Abstract. These are the configuration options for Zend_Session_SaveHandler_DbTable:
primaryAssignment => (string|array) Session table primary key value assignment (optional; default: 1 => sessionId) You have to assign a value to each primary key of your session table. The value of this configuration option is either a string if you have only one primary key or an array if you have multiple primary keys. The array consists of numeric keys starting at 1 and string values. There are some values which will be replaced by session information:
sessionId => The id of the current session
sessionName => The name of the current session
sessionSavePath => The save path of the current session
NOTE: One of your assignments MUST contain 'sessionId' as value!
modifiedColumn => (string) Session table last modification time column
lifetimeColumn => (string) Session table lifetime column
dataColumn => (string) Session table data column
lifetime => (integer) Session lifetime (optional; default: ini_get('session.gc_maxlifetime'))
overrideLifetime => (boolean) Whether or not the lifetime of an existing session should be overridden (optional; default: false)
inherited_from | \Zend_Db_Table_Abstract::__construct() |
---|
\Zend_Config
array
User-provided configuration
\Zend_Session_SaveHandler_Exception |
---|
__construct(mixed $config = array()
) : void
Supported params for $config are:
mixed
Array of user-specified config options, or just the Db Adapter.
__destruct() : void
_cascadeDelete(string $parentTableClassname, array $primaryKey) : integer
string
array
integer
Number of affected rows_cascadeUpdate(string $parentTableClassname, array $oldPrimaryKey, array $newPrimaryKey) : integer
string
array
array
integer
addReference(string $ruleKey, string|array $columns, string $refTableClass, string|array $refColumns, string $onDelete= null
, string $onUpdate= null
) : \Zend_Db_Table_Abstract
string
string
array
string
string
array
string
string
\Zend_Db_Table_Abstract
close() : boolean
inherited_from | \Zend_Session_SaveHandler_Interface::close() |
---|
boolean
createRow(array $data= array()
, string $defaultSource= null
) : \Zend_Db_Table_Row_Abstract
array
OPTIONAL data to populate in the new row.
string
OPTIONAL flag to force default values into new row
\Zend_Db_Table_Row_Abstract
delete(array|string $where) : integer
array
string
SQL WHERE clause(s).
integer
The number of rows deleted.destroy(string $id) : boolean
inherited_from | \Zend_Session_SaveHandler_Interface::destroy() |
---|
string
boolean
fetchAll(string|array|\Zend_Db_Table_Select $where= null
, string|array $order= null
, integer $count= null
, integer $offset= null
) : \Zend_Db_Table_Rowset_Abstract
Honors the Zend_Db_Adapter fetch mode.
string
array
\Zend_Db_Table_Select
OPTIONAL An SQL WHERE clause or Zend_Db_Table_Select object.
string
array
OPTIONAL An SQL ORDER clause.
integer
OPTIONAL An SQL LIMIT count.
integer
OPTIONAL An SQL LIMIT offset.
\Zend_Db_Table_Rowset_Abstract
The row results per the Zend_Db_Adapter fetch mode.fetchNew() : \Zend_Db_Table_Row_Abstract
deprecated | since 0.9.3 - use createRow() instead. |
---|
\Zend_Db_Table_Row_Abstract
fetchRow(string|array|\Zend_Db_Table_Select $where= null
, string|array $order= null
, integer $offset= null
) : \Zend_Db_Table_Row_Abstract | null
string
array
\Zend_Db_Table_Select
OPTIONAL An SQL WHERE clause or Zend_Db_Table_Select object.
string
array
OPTIONAL An SQL ORDER clause.
integer
OPTIONAL An SQL OFFSET value.
\Zend_Db_Table_Row_Abstract
null
The row results per the
Zend_Db_Adapter fetch mode, or null if no row found.find() : \Zend_Db_Table_Rowset_Abstract
This method accepts a variable number of arguments. If the table has a multi-column primary key, the number of arguments must be the same as the number of columns in the primary key. To find multiple rows in a table with a multi-column primary key, each argument must be an array with the same number of elements.
The find() method always returns a Rowset object, even if only one row was found.
\Zend_Db_Table_Exception |
---|
\Zend_Db_Table_Rowset_Abstract
Row(s) matching the criteria.gc(integer $maxlifetime) : true
inherited_from | \Zend_Session_SaveHandler_Interface::gc() |
---|
integer
true
getAdapter() : \Zend_Db_Adapter_Abstract
\Zend_Db_Adapter_Abstract
getDefaultAdapter() : \Zend_Db_Adapter_Abstract
\Zend_Db_Adapter_Abstract
or nullgetDefaultMetadataCache() : \Zend_Cache_Core
\Zend_Cache_Core
or nullgetDefaultSource() : \unknown
\unknown
getDefaultValues()
getDefinition() : \Zend_Db_Table_Definition | null
\Zend_Db_Table_Definition
null
getDefinitionConfigName() : string
string
getDependentTables() : array
array
getLifetime() : integer
integer
getMetadataCache() : \Zend_Cache_Core
\Zend_Cache_Core
or nullgetOverrideLifetime() : boolean
boolean
getReference(string $tableClassname, string $ruleKey = null
) : array
string
string
OPTIONAL
\Zend_Db_Table_Exception |
---|
array
getRowClass() : string
string
getRowsetClass() : string
string
getTableFromString(string $tableName, \Zend_Db_Table_Abstract $referenceTable = null
) : \Zend_Db_Table_Abstract
string
\Zend_Db_Table_Abstract
\Zend_Db_Table_Row_Exception |
---|
\Zend_Db_Table_Abstract
info(string $key = null
) : mixed
You can elect to return only a part of this information by supplying its key name, otherwise all information is returned as an array.
string
The specific info part to return OPTIONAL
\Zend_Db_Table_Exception |
---|
mixed
init() : void
Called from __construct() as final step of object instantiation.
insert(array $data) : mixed
array
Column-value pairs.
mixed
The primary key of the row inserted.isIdentity(string $column) : boolean
string
\Zend_Db_Table_Exception |
---|
boolean
open(string $save_path, string $name) : boolean
inherited_from | \Zend_Session_SaveHandler_Interface::open() |
---|
string
string
boolean
read(string $id) : string
inherited_from | \Zend_Session_SaveHandler_Interface::read() |
---|
string
string
select(boolean $withFromPart = self::SELECT_WITHOUT_FROM_PART
) : \Zend_Db_Table_Select
boolean
Whether or not to include the from part of the select based on the table
\Zend_Db_Table_Select
setDefaultAdapter(mixed $db = null
) : void
mixed
Either an Adapter object, or a string naming a Registry key
setDefaultMetadataCache(mixed $metadataCache = null
) : void
If $defaultMetadataCache is null, then no metadata cache is used by default.
mixed
Either a Cache object, or a string naming a Registry key
setDefaultSource(string $defaultSource = self::DEFAULT_NONE
) : \Zend_Db_Table_Abstract
string
\Zend_Db_Table_Abstract
setDefaultValues(array $defaultValues) : \Zend_Db_Table_Abstract
array
\Zend_Db_Table_Abstract
setDefinition(\Zend_Db_Table_Definition $definition) : \Zend_Db_Table_Abstract
\Zend_Db_Table_Definition
\Zend_Db_Table_Abstract
setDefinitionConfigName($definitionConfigName) : \Zend_Db_Table_Abstract
\Zend_Db_Table_Abstract
setDependentTables(array $dependentTables) : \Zend_Db_Table_Abstract
array
\Zend_Db_Table_Abstract
Provides a fluent interfacesetLifetime(integer $lifetime, boolean $overrideLifetime = null
) : \Zend_Session_SaveHandler_DbTable
$lifetime === false resets lifetime to session.gc_maxlifetime
integer
boolean
(optional)
\Zend_Session_SaveHandler_DbTable
setMetadataCacheInClass(boolean $flag) : \Zend_Db_Table_Abstract
boolean
\Zend_Db_Table_Abstract
setOptions(array $options) : \Zend_Db_Table_Abstract
array
\Zend_Db_Table_Abstract
setOverrideLifetime(boolean $overrideLifetime) : \Zend_Session_SaveHandler_DbTable
boolean
\Zend_Session_SaveHandler_DbTable
setReferences(array $referenceMap) : \Zend_Db_Table_Abstract
array
\Zend_Db_Table_Abstract
Provides a fluent interfacesetRowClass(string $classname) : \Zend_Db_Table_Abstract
string
\Zend_Db_Table_Abstract
Provides a fluent interfacesetRowsetClass(string $classname) : \Zend_Db_Table_Abstract
string
\Zend_Db_Table_Abstract
Provides a fluent interfaceupdate(array $data, array|string $where) : integer
array
Column-value pairs.
array
string
An SQL WHERE clause, or an array of SQL WHERE clauses.
integer
The number of rows updated.write(string $id, string $data) : boolean
inherited_from | \Zend_Session_SaveHandler_Interface::write() |
---|
string
string
boolean
_checkRequiredColumns() : void
\Zend_Session_SaveHandler_Exception |
---|
_fetch(\Zend_Db_Table_Select $select) : array
\Zend_Db_Table_Select
query options.
array
An array containing the row results in FETCH_ASSOC mode._getCols() : array
array
_getExpirationTime(\Zend_Db_Table_Row_Abstract $row) : integer
\Zend_Db_Table_Row_Abstract
integer
_getLifetime(\Zend_Db_Table_Row_Abstract $row) : integer
\Zend_Db_Table_Row_Abstract
integer
_getPrimary(string $id, string $type = null
) : array
string
string
(optional; default: self::PRIMARY_TYPE_NUM)
array
_getReferenceMapNormalized() : array
array
_order(\Zend_Db_Table_Select $select, string|array $order) : \Zend_Db_Table_Select
string
array
OPTIONAL An SQL ORDER clause.
\Zend_Db_Table_Select
_setAdapter(mixed $db) : \Zend_Db_Table_Abstract
mixed
Either an Adapter object, or a string naming a Registry key
\Zend_Db_Table_Abstract
Provides a fluent interface_setMetadataCache(mixed $metadataCache) : \Zend_Db_Table_Abstract
If $metadataCache is null, then no metadata cache is used. Since there is no opportunity to reload metadata after instantiation, this method need not be public, particularly because that it would have no effect results in unnecessary API complexity. To configure the metadata cache, use the metadataCache configuration option for the class constructor upon instantiation.
mixed
Either a Cache object, or a string naming a Registry key
\Zend_Db_Table_Abstract
Provides a fluent interface_setSequence(mixed $sequence) : \Zend_Db_Table_Adapter_Abstract
mixed
\Zend_Db_Table_Adapter_Abstract
Provides a fluent interface_setup() : void
Calls other protected methods for individual tasks, to make it easier for a subclass to override part of the setup logic.
inherited_from | \Zend_Db_Table_Abstract::_setup() |
---|
_setup() : void
Calls other protected methods for individual tasks, to make it easier for a subclass to override part of the setup logic.
_setupAdapter(mixed $db) : \Zend_Db_Adapter_Abstract
mixed
Either an Adapter object, or a string naming a Registry key
\Zend_Db_Table_Exception |
---|
\Zend_Db_Adapter_Abstract
_setupDatabaseAdapter() : void
\Zend_Db_Table_Exception |
---|
_setupMetadata() : boolean
If metadata cannot be loaded from cache, adapter's describeTable() method is called to discover metadata information. Returns true if and only if the metadata are loaded from cache.
\Zend_Db_Table_Exception |
---|
boolean
_setupMetadataCache(mixed $metadataCache) : \Zend_Cache_Core
mixed
Either a Cache object, or a string naming a Registry key
\Zend_Db_Table_Exception |
---|
\Zend_Cache_Core
_setupPrimaryAssignment() : void
\Zend_Session_SaveHandler_Exception |
---|
_setupPrimaryKey() : void
If $_primary is not defined, discover primary keys from the information returned by describeTable().
\Zend_Db_Table_Exception |
---|
_setupTableName() : void
If the table name is not set in the class definition, use the class name itself as the table name.
A schema name provided with the table name (e.g., "schema.table") overrides any existing value for $this->_schema.
inherited_from | \Zend_Db_Table_Abstract::_setupTableName() |
---|
\Zend_Session_SaveHandler_Exception |
---|
_setupTableName() : void
If the table name is not set in the class definition, use the class name itself as the table name.
A schema name provided with the table name (e.g., "schema.table") overrides any existing value for $this->_schema.
_where(\Zend_Db_Table_Select $select, string|array $where) : \Zend_Db_Table_Select
string
array
OPTIONAL An SQL WHERE clause.
\Zend_Db_Table_Select
$_cols : array
$_dataColumn : string
null
$_db : \Zend_Db_Adapter_Abstract
$_defaultDb : \Zend_Db_Adapter_Abstract
$_defaultMetadataCache : \Zend_Cache_Core
null
$_defaultSource
self::DEFAULT_NONE
$_defaultValues
array()
$_definition : \unknown_type
null
$_definitionConfigName : string
null
$_dependentTables : array
array()
Array elements are not table names; they are class names of classes that extend Zend_Db_Table_Abstract.
$_identity : integer
1
Note this index is the position of the column in the primary key, not the position of the column in the table. The primary key array is 1-based.
$_lifetime : integer
false
$_lifetimeColumn : string
null
$_modifiedColumn : string
null
$_name : string
null
$_overrideLifetime : boolean
false
$_primary : mixed
null
A compound key should be declared as an array. You may declare a single-column primary key as a string.
$_primaryAssignment : array
null
$_referenceMap : array
array()
This array has one entry per foreign key in the current table. Each key is a mnemonic name for one reference rule.
Each value is also an associative array, with the following keys:
$_rowClass : string
'Zend_Db_Table_Row'
$_rowsetClass : string
'Zend_Db_Table_Rowset'
$_schema : array
null
$_sequence : mixed
true
May be a string, boolean true, or boolean false.
$_sessionName : string
$_sessionSavePath : string
ADAPTER = 'db'
CASCADE = 'cascade'
CASCADE_RECURSE = 'cascadeRecurse'
COLS = 'cols'
COLUMNS = 'columns'
DATA_COLUMN = 'dataColumn'
DEFAULT_CLASS = 'defaultClass'
DEFAULT_DB = 'defaultDb'
DEFAULT_NONE = 'defaultNone'
DEFINITION = 'definition'
DEFINITION_CONFIG_NAME = 'definitionConfigName'
DEPENDENT_TABLES = 'dependentTables'
LIFETIME = 'lifetime'
LIFETIME_COLUMN = 'lifetimeColumn'
METADATA = 'metadata'
METADATA_CACHE = 'metadataCache'
METADATA_CACHE_IN_CLASS = 'metadataCacheInClass'
MODIFIED_COLUMN = 'modifiedColumn'
NAME = 'name'
ON_DELETE = 'onDelete'
ON_UPDATE = 'onUpdate'
OVERRIDE_LIFETIME = 'overrideLifetime'
PRIMARY = 'primary'
PRIMARY_ASSIGNMENT = 'primaryAssignment'
PRIMARY_ASSIGNMENT_SESSION_ID = 'sessionId'
PRIMARY_ASSIGNMENT_SESSION_NAME = 'sessionName'
PRIMARY_ASSIGNMENT_SESSION_SAVE_PATH = 'sessionSavePath'
PRIMARY_TYPE_ASSOC = 'PRIMARY_TYPE_ASSOC'
PRIMARY_TYPE_NUM = 'PRIMARY_TYPE_NUM'
PRIMARY_TYPE_PRIMARYNUM = 'PRIMARY_TYPE_PRIMARYNUM'
PRIMARY_TYPE_WHERECLAUSE = 'PRIMARY_TYPE_WHERECLAUSE'
REFERENCE_MAP = 'referenceMap'
REF_COLUMNS = 'refColumns'
REF_TABLE_CLASS = 'refTableClass'
RESTRICT = 'restrict'
ROWSET_CLASS = 'rowsetClass'
ROW_CLASS = 'rowClass'
SCHEMA = 'schema'
SELECT_WITHOUT_FROM_PART = false
SELECT_WITH_FROM_PART = true
SEQUENCE = 'sequence'
SET_NULL = 'setNull'