Session/SaveHandler/DbTable.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-webat this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Session  
Version
$Id: DbTable.php 24593 2012-01-05 20:35:02Z matthew $  

\Zend_Session_SaveHandler_DbTable

Package: Zend\Session\SaveHandler
Zend_Session_SaveHandler_DbTable
Implements
\Zend_Session_SaveHandler_Interface
Parent(s)
\Zend_Db_Table_Abstract
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

>VConstant  PRIMARY_ASSIGNMENT = 'primaryAssignment'
>VConstant  PRIMARY_ASSIGNMENT_SESSION_SAVE_PATH = 'sessionSavePath'
>VConstant  PRIMARY_ASSIGNMENT_SESSION_NAME = 'sessionName'
>VConstant  PRIMARY_ASSIGNMENT_SESSION_ID = 'sessionId'
>VConstant  MODIFIED_COLUMN = 'modifiedColumn'
>VConstant  LIFETIME_COLUMN = 'lifetimeColumn'
>VConstant  DATA_COLUMN = 'dataColumn'
>VConstant  LIFETIME = 'lifetime'
>VConstant  OVERRIDE_LIFETIME = 'overrideLifetime'
>VConstant  PRIMARY_TYPE_NUM = 'PRIMARY_TYPE_NUM'
>VConstant  PRIMARY_TYPE_PRIMARYNUM = 'PRIMARY_TYPE_PRIMARYNUM'
>VConstant  PRIMARY_TYPE_ASSOC = 'PRIMARY_TYPE_ASSOC'
>VConstant  PRIMARY_TYPE_WHERECLAUSE = 'PRIMARY_TYPE_WHERECLAUSE'
>VConstant  ADAPTER = 'db'
inheritedInherited from: \Zend_Db_Table_Abstract::ADAPTER
>VConstant  DEFINITION = 'definition'
inheritedInherited from: \Zend_Db_Table_Abstract::DEFINITION
>VConstant  DEFINITION_CONFIG_NAME = 'definitionConfigName'
>VConstant  SCHEMA = 'schema'
inheritedInherited from: \Zend_Db_Table_Abstract::SCHEMA
>VConstant  NAME = 'name'
inheritedInherited from: \Zend_Db_Table_Abstract::NAME
>VConstant  PRIMARY = 'primary'
inheritedInherited from: \Zend_Db_Table_Abstract::PRIMARY
>VConstant  COLS = 'cols'
inheritedInherited from: \Zend_Db_Table_Abstract::COLS
>VConstant  METADATA = 'metadata'
inheritedInherited from: \Zend_Db_Table_Abstract::METADATA
>VConstant  METADATA_CACHE = 'metadataCache'
>VConstant  METADATA_CACHE_IN_CLASS = 'metadataCacheInClass'
>VConstant  ROW_CLASS = 'rowClass'
inheritedInherited from: \Zend_Db_Table_Abstract::ROW_CLASS
>VConstant  ROWSET_CLASS = 'rowsetClass'
inheritedInherited from: \Zend_Db_Table_Abstract::ROWSET_CLASS
>VConstant  REFERENCE_MAP = 'referenceMap'
>VConstant  DEPENDENT_TABLES = 'dependentTables'
>VConstant  SEQUENCE = 'sequence'
inheritedInherited from: \Zend_Db_Table_Abstract::SEQUENCE
>VConstant  COLUMNS = 'columns'
inheritedInherited from: \Zend_Db_Table_Abstract::COLUMNS
>VConstant  REF_TABLE_CLASS = 'refTableClass'
>VConstant  REF_COLUMNS = 'refColumns'
inheritedInherited from: \Zend_Db_Table_Abstract::REF_COLUMNS
>VConstant  ON_DELETE = 'onDelete'
inheritedInherited from: \Zend_Db_Table_Abstract::ON_DELETE
>VConstant  ON_UPDATE = 'onUpdate'
inheritedInherited from: \Zend_Db_Table_Abstract::ON_UPDATE
>VConstant  CASCADE = 'cascade'
inheritedInherited from: \Zend_Db_Table_Abstract::CASCADE
>VConstant  CASCADE_RECURSE = 'cascadeRecurse'
>VConstant  RESTRICT = 'restrict'
inheritedInherited from: \Zend_Db_Table_Abstract::RESTRICT
>VConstant  SET_NULL = 'setNull'
inheritedInherited from: \Zend_Db_Table_Abstract::SET_NULL
>VConstant  DEFAULT_NONE = 'defaultNone'
inheritedInherited from: \Zend_Db_Table_Abstract::DEFAULT_NONE
>VConstant  DEFAULT_CLASS = 'defaultClass'
>VConstant  DEFAULT_DB = 'defaultDb'
inheritedInherited from: \Zend_Db_Table_Abstract::DEFAULT_DB
>VConstant  SELECT_WITH_FROM_PART = true
>VConstant  SELECT_WITHOUT_FROM_PART = false

Properties

>VPropertyprotectedarray $_cols
inherited
The table column names derived from Zend_Db_Adapter_Abstract::describeTable().
Inherited from: \Zend_Db_Table_Abstract::$$_cols
Details
Type
array
Inherited_from
\Zend_Db_Table_Abstract::$$_cols  
>VPropertyprotectedstring $_dataColumn = null
Session table data column
Default valuenullDetails
Type
string
>VPropertyprotected\Zend_Db_Adapter_Abstract $_db
inherited
Zend_Db_Adapter_Abstract object.
Inherited from: \Zend_Db_Table_Abstract::$$_db
>VPropertyprotected\Zend_Db_Adapter_Abstract $_defaultDb
staticinherited
Default Zend_Db_Adapter_Abstract object.
Inherited from: \Zend_Db_Table_Abstract::$$_defaultDb
>VPropertyprotected\Zend_Cache_Core $_defaultMetadataCache = null
staticinherited
Default cache for information provided by the adapter's describeTable() method.
Inherited from: \Zend_Db_Table_Abstract::$$_defaultMetadataCache
Default valuenullDetails
Type
\Zend_Cache_Core
Inherited_from
\Zend_Db_Table_Abstract::$$_defaultMetadataCache  
>VPropertyprotected$_defaultSource = self::DEFAULT_NONE
Default valueself::DEFAULT_NONEDetails
Type
n/a
Inherited_from
\Zend_Db_Table_Abstract::$$_defaultSource  
>VPropertyprotected$_defaultValues = array()
Default valuearray()Details
Type
n/a
Inherited_from
\Zend_Db_Table_Abstract::$$_defaultValues  
>VPropertyprotected\unknown_type $_definition = null
inherited
Optional Zend_Db_Table_Definition object
Inherited from: \Zend_Db_Table_Abstract::$$_definition
Default valuenullDetails
Type
\unknown_type
Inherited_from
\Zend_Db_Table_Abstract::$$_definition  
>VPropertyprotectedstring $_definitionConfigName = null
inherited
Optional definition config name used in concrete implementation
Inherited from: \Zend_Db_Table_Abstract::$$_definitionConfigName
Default valuenullDetails
Type
string
Inherited_from
\Zend_Db_Table_Abstract::$$_definitionConfigName  
>VPropertyprotectedarray $_dependentTables = array()
inherited
Simple array of class names of tables that are "children" of the current table, in other words tables that contain a foreign key to this one.
Inherited from: \Zend_Db_Table_Abstract::$$_dependentTables

Array elements are not table names; they are class names of classes that extend Zend_Db_Table_Abstract.

Default valuearray()Details
Type
array
Inherited_from
\Zend_Db_Table_Abstract::$$_dependentTables  
>VPropertyprotectedinteger $_identity = 1
inherited
If your primary key is a compound key, and one of the columns uses an auto-increment or sequence-generated value, set _identity to the ordinal index in the $_primary array for that column.
Inherited from: \Zend_Db_Table_Abstract::$$_identity

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.

Default value1Details
Type
integer
Inherited_from
\Zend_Db_Table_Abstract::$$_identity  
>VPropertyprotectedint $_lifetime = false
Session lifetime
Default valuefalseDetails
Type
int
>VPropertyprotectedstring $_lifetimeColumn = null
Session table lifetime column
Default valuenullDetails
Type
string
>VPropertyprotectedarray $_metadata = array()
inherited
Information provided by the adapter's describeTable() method.
Inherited from: \Zend_Db_Table_Abstract::$$_metadata
Default valuearray()Details
Type
array
Inherited_from
\Zend_Db_Table_Abstract::$$_metadata  
>VPropertyprotected\Zend_Cache_Core $_metadataCache = null
inherited
Cache for information provided by the adapter's describeTable() method.
Inherited from: \Zend_Db_Table_Abstract::$$_metadataCache
Default valuenullDetails
Type
\Zend_Cache_Core
Inherited_from
\Zend_Db_Table_Abstract::$$_metadataCache  
>VPropertyprotectedbool $_metadataCacheInClass = true
inherited
Flag: whether or not to cache metadata in the class
Inherited from: \Zend_Db_Table_Abstract::$$_metadataCacheInClass
Default valuetrueDetails
Type
bool
Inherited_from
\Zend_Db_Table_Abstract::$$_metadataCacheInClass  
>VPropertyprotectedstring $_modifiedColumn = null
Session table last modification time column
Default valuenullDetails
Type
string
>VPropertyprotectedstring $_name = null
inherited
The table name.
Inherited from: \Zend_Db_Table_Abstract::$$_name
Default valuenullDetails
Type
string
Inherited_from
\Zend_Db_Table_Abstract::$$_name  
>VPropertyprotectedboolean $_overrideLifetime = false
Whether or not the lifetime of an existing session should be overridden
Default valuefalseDetails
Type
boolean
>VPropertyprotectedmixed $_primary = null
inherited
The primary key column or columns.
Inherited from: \Zend_Db_Table_Abstract::$$_primary

A compound key should be declared as an array. You may declare a single-column primary key as a string.

Default valuenullDetails
Type
mixed
Inherited_from
\Zend_Db_Table_Abstract::$$_primary  
>VPropertyprotectedarray $_primaryAssignment = null
Session table primary key value assignment
Default valuenullDetails
Type
array
>VPropertyprotectedarray $_referenceMap = array()
inherited
Associative array map of declarative referential integrity rules.
Inherited from: \Zend_Db_Table_Abstract::$$_referenceMap

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: - columns = array of names of column(s) in the child table. - refTableClass = class name of the parent table. - refColumns = array of names of column(s) in the parent table, in the same order as those in the 'columns' entry. - onDelete = "cascade" means that a delete in the parent table also causes a delete of referencing rows in the child table. - onUpdate = "cascade" means that an update of primary key values in the parent table also causes an update of referencing rows in the child table.

Default valuearray()Details
Type
array
Inherited_from
\Zend_Db_Table_Abstract::$$_referenceMap  
>VPropertyprotectedstring $_rowClass = 'Zend_Db_Table_Row'
inherited
Classname for row
Inherited from: \Zend_Db_Table_Abstract::$$_rowClass
Default value'Zend_Db_Table_Row'Details
Type
string
Inherited_from
\Zend_Db_Table_Abstract::$$_rowClass  
>VPropertyprotectedstring $_rowsetClass = 'Zend_Db_Table_Rowset'
inherited
Classname for rowset
Inherited from: \Zend_Db_Table_Abstract::$$_rowsetClass
Default value'Zend_Db_Table_Rowset'Details
Type
string
Inherited_from
\Zend_Db_Table_Abstract::$$_rowsetClass  
>VPropertyprotectedarray $_schema = null
inherited
The schema name (default null means current schema)
Inherited from: \Zend_Db_Table_Abstract::$$_schema
Default valuenullDetails
Type
array
Inherited_from
\Zend_Db_Table_Abstract::$$_schema  
>VPropertyprotectedmixed $_sequence = true
inherited
Define the logic for new values in the primary key.
Inherited from: \Zend_Db_Table_Abstract::$$_sequence

May be a string, boolean true, or boolean false.

Default valuetrueDetails
Type
mixed
Inherited_from
\Zend_Db_Table_Abstract::$$_sequence  
>VPropertyprotectedstring $_sessionName
Session name
Details
Type
string
>VPropertyprotectedstring $_sessionSavePath
Session save path
Details
Type
string

Methods

methodpublic__construct(\Zend_Config | array $config) : void

Constructor

$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)

Parameters
NameTypeDescription
$config\Zend_Config | array

User-provided configuration

Throws
ExceptionDescription
\Zend_Session_SaveHandler_Exception
methodpublic__destruct() : void

Destructor

methodpublic_cascadeDelete(string $parentTableClassname, array $primaryKey) : int
inherited

Called by parent table's class during delete() method.

Inherited from: \Zend_Db_Table_Abstract::_cascadeDelete()
Parameters
NameTypeDescription
$parentTableClassnamestring
$primaryKeyarray
Returns
TypeDescription
intNumber of affected rows
methodpublic_cascadeUpdate(string $parentTableClassname, array $oldPrimaryKey, array $newPrimaryKey) : int
inherited

Called by a row object for the parent table's class during save() method.

Inherited from: \Zend_Db_Table_Abstract::_cascadeUpdate()
Parameters
NameTypeDescription
$parentTableClassnamestring
$oldPrimaryKeyarray
$newPrimaryKeyarray
Returns
TypeDescription
int
methodprotected_checkRequiredColumns() : void

Check for required session table columns

Throws
ExceptionDescription
\Zend_Session_SaveHandler_Exception
methodprotected_fetch(\Zend_Db_Table_Select $select) : array
inherited

Support method for fetching rows.

Inherited from: \Zend_Db_Table_Abstract::_fetch()
Parameters
NameTypeDescription
$select\Zend_Db_Table_Select

query options.

Returns
TypeDescription
arrayAn array containing the row results in FETCH_ASSOC mode.
methodprotected_getCols() : array
inherited

Retrieve table columns

Inherited from: \Zend_Db_Table_Abstract::_getCols()
Returns
TypeDescription
array
methodprotected_getExpirationTime(\Zend_Db_Table_Row_Abstract $row) : int

Retrieve session expiration time

Parameters
NameTypeDescription
$row\Zend_Db_Table_Row_Abstract
Returns
TypeDescription
int
methodprotected_getLifetime(\Zend_Db_Table_Row_Abstract $row) : int

Retrieve session lifetime considering Zend_Session_SaveHandler_DbTable::OVERRIDE_LIFETIME

Parameters
NameTypeDescription
$row\Zend_Db_Table_Row_Abstract
Returns
TypeDescription
int
methodprotected_getPrimary(string $id, string $type = null) : array

Retrieve session table primary key values

Parameters
NameTypeDescription
$idstring
$typestring

(optional; default: self::PRIMARY_TYPE_NUM)

Returns
TypeDescription
array
methodprotected_getReferenceMapNormalized() : array
inherited

Returns a normalized version of the reference map

Inherited from: \Zend_Db_Table_Abstract::_getReferenceMapNormalized()
Returns
TypeDescription
array
methodprotected_order( $select, string | array $order) : \Zend_Db_Table_Select
inherited

Generate ORDER clause from user-supplied string or array

Inherited from: \Zend_Db_Table_Abstract::_order()
Parameters
NameTypeDescription
$select
$orderstring | array

OPTIONAL An SQL ORDER clause.

Returns
TypeDescription
\Zend_Db_Table_Select
methodprotected_setAdapter(mixed $db) : \Zend_Db_Table_Abstract
Parameters
NameTypeDescription
$dbmixed

Either an Adapter object, or a string naming a Registry key

Returns
TypeDescription
\Zend_Db_Table_AbstractProvides a fluent interface
methodprotected_setMetadataCache(mixed $metadataCache) : \Zend_Db_Table_Abstract
inherited

Sets the metadata cache for information returned by Zend_Db_Adapter_Abstract::describeTable().

Inherited from: \Zend_Db_Table_Abstract::_setMetadataCache()

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.

Parameters
NameTypeDescription
$metadataCachemixed

Either a Cache object, or a string naming a Registry key

Returns
TypeDescription
\Zend_Db_Table_AbstractProvides a fluent interface
methodprotected_setSequence(mixed $sequence) : \Zend_Db_Table_Adapter_Abstract
inherited

Sets the sequence member, which defines the behavior for generating primary key values in new rows.

Inherited from: \Zend_Db_Table_Abstract::_setSequence()
  • If this is a string, then the string names the sequence object.
  • If this is boolean true, then the key uses an auto-incrementing or identity mechanism.
  • If this is boolean false, then the key is user-defined. Use this for natural keys, for example.
Parameters
NameTypeDescription
$sequencemixed
Returns
TypeDescription
\Zend_Db_Table_Adapter_AbstractProvides a fluent interface
methodprotected_setup() : void

Calls other protected methods for individual setup tasks and requirement checks

Calls other protected methods for individual tasks, to make it easier for a subclass to override part of the setup logic.

methodprotected_setupAdapter(mixed $db) : \Zend_Db_Adapter_Abstract
staticinherited

Inherited from: \Zend_Db_Table_Abstract::_setupAdapter()
Parameters
NameTypeDescription
$dbmixed

Either an Adapter object, or a string naming a Registry key

Returns
TypeDescription
\Zend_Db_Adapter_Abstract
Throws
ExceptionDescription
\Zend_Db_Table_Exception
methodprotected_setupDatabaseAdapter() : void
inherited

Initialize database adapter.

Inherited from: \Zend_Db_Table_Abstract::_setupDatabaseAdapter()
Throws
ExceptionDescription
\Zend_Db_Table_Exception
methodprotected_setupMetadata() : boolean
inherited

Initializes metadata.

Inherited from: \Zend_Db_Table_Abstract::_setupMetadata()

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.

Returns
TypeDescription
boolean
Throws
ExceptionDescription
\Zend_Db_Table_Exception
methodprotected_setupMetadataCache(mixed $metadataCache) : \Zend_Cache_Core
staticinherited

Inherited from: \Zend_Db_Table_Abstract::_setupMetadataCache()
Parameters
NameTypeDescription
$metadataCachemixed

Either a Cache object, or a string naming a Registry key

Returns
TypeDescription
\Zend_Cache_Core
Throws
ExceptionDescription
\Zend_Db_Table_Exception
methodprotected_setupPrimaryAssignment() : void

Initialize session table primary key value assignment

Throws
ExceptionDescription
\Zend_Session_SaveHandler_Exception
methodprotected_setupPrimaryKey() : void
inherited

Initialize primary key from metadata.

Inherited from: \Zend_Db_Table_Abstract::_setupPrimaryKey()

If $_primary is not defined, discover primary keys from the information returned by describeTable().

Throws
ExceptionDescription
\Zend_Db_Table_Exception
methodprotected_setupTableName() : void

Initialize table and schema names

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.

Throws
ExceptionDescription
\Zend_Session_SaveHandler_Exception
methodprotected_where( $select, string | array $where) : \Zend_Db_Table_Select
inherited

Generate WHERE clause from user-supplied string or array

Inherited from: \Zend_Db_Table_Abstract::_where()
Parameters
NameTypeDescription
$select
$wherestring | array

OPTIONAL An SQL WHERE clause.

Returns
TypeDescription
\Zend_Db_Table_Select
methodpublicaddReference(string $ruleKey, string | array $columns, string $refTableClass, string | array $refColumns, string $onDelete = null, string $onUpdate = null) : \Zend_Db_Table_Abstract
inherited

Add a reference to the reference map

Inherited from: \Zend_Db_Table_Abstract::addReference()
Parameters
NameTypeDescription
$ruleKeystring
$columnsstring | array
$refTableClassstring
$refColumnsstring | array
$onDeletestring
$onUpdatestring
Returns
TypeDescription
\Zend_Db_Table_Abstract
methodpublicclose() : boolean

Close session

Returns
TypeDescription
boolean
methodpubliccreateRow(array $data = array(), string $defaultSource = null) : \Zend_Db_Table_Row_Abstract
inherited

Fetches a new blank row (not from the database).

Inherited from: \Zend_Db_Table_Abstract::createRow()
Parameters
NameTypeDescription
$dataarray

OPTIONAL data to populate in the new row.

$defaultSourcestring

OPTIONAL flag to force default values into new row

Returns
TypeDescription
\Zend_Db_Table_Row_Abstract
methodpublicdelete(array | string $where) : int
inherited

Deletes existing rows.

Inherited from: \Zend_Db_Table_Abstract::delete()
Parameters
NameTypeDescription
$wherearray | string

SQL WHERE clause(s).

Returns
TypeDescription
intThe number of rows deleted.
methodpublicdestroy(string $id) : boolean

Destroy session

Parameters
NameTypeDescription
$idstring
Returns
TypeDescription
boolean
methodpublicfetchAll(string | array | \Zend_Db_Table_Select $where = null, string | array $order = null, int $count = null, int $offset = null) : \Zend_Db_Table_Rowset_Abstract
inherited

Fetches all rows.

Inherited from: \Zend_Db_Table_Abstract::fetchAll()

Honors the Zend_Db_Adapter fetch mode.

Parameters
NameTypeDescription
$wherestring | array | \Zend_Db_Table_Select

OPTIONAL An SQL WHERE clause or Zend_Db_Table_Select object.

$orderstring | array

OPTIONAL An SQL ORDER clause.

$countint

OPTIONAL An SQL LIMIT count.

$offsetint

OPTIONAL An SQL LIMIT offset.

Returns
TypeDescription
\Zend_Db_Table_Rowset_AbstractThe row results per the Zend_Db_Adapter fetch mode.
methodpublicfetchNew() : \Zend_Db_Table_Row_Abstract
inherited

Fetches a new blank row (not from the database).

Inherited from: \Zend_Db_Table_Abstract::fetchNew()
Returns
TypeDescription
\Zend_Db_Table_Row_Abstract
methodpublicfetchRow(string | array | \Zend_Db_Table_Select $where = null, string | array $order = null, int $offset = null) : \Zend_Db_Table_Row_Abstract | null
inherited

Fetches one row in an object of type Zend_Db_Table_Row_Abstract, or returns null if no row matches the specified criteria.

Inherited from: \Zend_Db_Table_Abstract::fetchRow()
Parameters
NameTypeDescription
$wherestring | array | \Zend_Db_Table_Select

OPTIONAL An SQL WHERE clause or Zend_Db_Table_Select object.

$orderstring | array

OPTIONAL An SQL ORDER clause.

$offsetint

OPTIONAL An SQL OFFSET value.

Returns
TypeDescription
\Zend_Db_Table_Row_Abstract | nullThe row results per the Zend_Db_Adapter fetch mode, or null if no row found.
methodpublicfind() : \Zend_Db_Table_Rowset_Abstract
inherited

Fetches rows by primary key.

Inherited from: \Zend_Db_Table_Abstract::find()

The argument specifies one or more primary key value(s). To find multiple rows by primary key, the argument must be an array.

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.

Returns
TypeDescription
\Zend_Db_Table_Rowset_AbstractRow(s) matching the criteria.
Throws
ExceptionDescription
\Zend_Db_Table_Exception
methodpublicgc(int $maxlifetime) : true

Garbage Collection

Parameters
NameTypeDescription
$maxlifetimeint
Returns
TypeDescription
true
methodpublicgetAdapter() : \Zend_Db_Adapter_Abstract
inherited

Gets the Zend_Db_Adapter_Abstract for this particular Zend_Db_Table object.

Inherited from: \Zend_Db_Table_Abstract::getAdapter()
Returns
TypeDescription
\Zend_Db_Adapter_Abstract
methodpublicgetDefaultAdapter() : \Zend_Db_Adapter_Abstract
staticinherited

Gets the default Zend_Db_Adapter_Abstract for all Zend_Db_Table objects.

Inherited from: \Zend_Db_Table_Abstract::getDefaultAdapter()
Returns
TypeDescription
\Zend_Db_Adapter_Abstractor null
methodpublicgetDefaultMetadataCache() : \Zend_Cache_Core
staticinherited

Gets the default metadata cache for information returned by Zend_Db_Adapter_Abstract::describeTable().

Inherited from: \Zend_Db_Table_Abstract::getDefaultMetadataCache()
Returns
TypeDescription
\Zend_Cache_Coreor null
methodpublicgetDefaultSource() : \unknown
inherited

returns the default source flag that determines where defaultSources come from

Inherited from: \Zend_Db_Table_Abstract::getDefaultSource()
Returns
TypeDescription
\unknown
methodpublicgetDefaultValues() : void
methodpublicgetDefinition() : \Zend_Db_Table_Definition | null
inherited

getDefinition()

Inherited from: \Zend_Db_Table_Abstract::getDefinition()
Returns
TypeDescription
\Zend_Db_Table_Definition | null
methodpublicgetDefinitionConfigName() : string
inherited

getDefinitionConfigName()

Inherited from: \Zend_Db_Table_Abstract::getDefinitionConfigName()
Returns
TypeDescription
string
methodpublicgetDependentTables() : array
Returns
TypeDescription
array
methodpublicgetLifetime() : int

Retrieve session lifetime

Returns
TypeDescription
int
methodpublicgetMetadataCache() : \Zend_Cache_Core
inherited

Gets the metadata cache for information returned by Zend_Db_Adapter_Abstract::describeTable().

Inherited from: \Zend_Db_Table_Abstract::getMetadataCache()
Returns
TypeDescription
\Zend_Cache_Coreor null
methodpublicgetOverrideLifetime() : boolean

Retrieve whether or not the lifetime of an existing session should be overridden

Returns
TypeDescription
boolean
methodpublicgetReference(string $tableClassname, string $ruleKey = null) : array
Parameters
NameTypeDescription
$tableClassnamestring
$ruleKeystring

OPTIONAL

Returns
TypeDescription
array
Throws
ExceptionDescription
\Zend_Db_Table_Exception
methodpublicgetRowClass() : string
Returns
TypeDescription
string
methodpublicgetRowsetClass() : string
Returns
TypeDescription
string
methodpublicgetTableFromString( $tableName,  $referenceTable = null) : void
staticinherited

Inherited from: \Zend_Db_Table_Abstract::getTableFromString()
Parameters
NameTypeDescription
$tableName
$referenceTable
methodpublicinfo(string $key = null) : mixed
inherited

Returns table information.

Inherited from: \Zend_Db_Table_Abstract::info()

You can elect to return only a part of this information by supplying its key name, otherwise all information is returned as an array.

Parameters
NameTypeDescription
$keystring

The specific info part to return OPTIONAL

Returns
TypeDescription
mixed
Throws
ExceptionDescription
\Zend_Db_Table_Exception
methodpublicinit() : void
inherited

Initialize object

Inherited from: \Zend_Db_Table_Abstract::init()

Called from __construct() as final step of object instantiation.

methodpublicinsert(array $data) : mixed
inherited

Inserts a new row.

Inherited from: \Zend_Db_Table_Abstract::insert()
Parameters
NameTypeDescription
$dataarray

Column-value pairs.

Returns
TypeDescription
mixedThe primary key of the row inserted.
methodpublicisIdentity(string $column) : boolean
inherited

Check if the provided column is an identity of the table

Inherited from: \Zend_Db_Table_Abstract::isIdentity()
Parameters
NameTypeDescription
$columnstring
Returns
TypeDescription
boolean
Throws
ExceptionDescription
\Zend_Db_Table_Exception
methodpublicmetadataCacheInClass() : bool
inherited

Retrieve flag indicating if metadata should be cached for duration of instance

Inherited from: \Zend_Db_Table_Abstract::metadataCacheInClass()
Returns
TypeDescription
bool
methodpublicopen(string $save_path, string $name) : boolean

Open Session

Parameters
NameTypeDescription
$save_pathstring
$namestring
Returns
TypeDescription
boolean
methodpublicread(string $id) : string

Read session data

Parameters
NameTypeDescription
$idstring
Returns
TypeDescription
string
methodpublicselect(bool $withFromPart = self::SELECT_WITHOUT_FROM_PART) : \Zend_Db_Table_Select
inherited

Returns an instance of a Zend_Db_Table_Select object.

Inherited from: \Zend_Db_Table_Abstract::select()
Parameters
NameTypeDescription
$withFromPartbool

Whether or not to include the from part of the select based on the table

Returns
TypeDescription
\Zend_Db_Table_Select
methodpublicsetDefaultAdapter(mixed $db = null) : void
staticinherited

Sets the default Zend_Db_Adapter_Abstract for all Zend_Db_Table objects.

Inherited from: \Zend_Db_Table_Abstract::setDefaultAdapter()
Parameters
NameTypeDescription
$dbmixed

Either an Adapter object, or a string naming a Registry key

methodpublicsetDefaultMetadataCache(mixed $metadataCache = null) : void
staticinherited

Sets the default metadata cache for information returned by Zend_Db_Adapter_Abstract::describeTable().

Inherited from: \Zend_Db_Table_Abstract::setDefaultMetadataCache()

If $defaultMetadataCache is null, then no metadata cache is used by default.

Parameters
NameTypeDescription
$metadataCachemixed

Either a Cache object, or a string naming a Registry key

methodpublicsetDefaultSource(string $defaultSource = self::DEFAULT_NONE) : \Zend_Db_Table_Abstract
inherited

set the defaultSource property - this tells the table class where to find default values

Inherited from: \Zend_Db_Table_Abstract::setDefaultSource()
Parameters
NameTypeDescription
$defaultSourcestring
Returns
TypeDescription
\Zend_Db_Table_Abstract
methodpublicsetDefaultValues(array $defaultValues) : \Zend_Db_Table_Abstract
inherited

set the default values for the table class

Inherited from: \Zend_Db_Table_Abstract::setDefaultValues()
Parameters
NameTypeDescription
$defaultValuesarray
Returns
TypeDescription
\Zend_Db_Table_Abstract
methodpublicsetDefinition(\Zend_Db_Table_Definition $definition) : \Zend_Db_Table_Abstract
inherited

setDefinition()

Inherited from: \Zend_Db_Table_Abstract::setDefinition()
Parameters
NameTypeDescription
$definition\Zend_Db_Table_Definition
Returns
TypeDescription
\Zend_Db_Table_Abstract
methodpublicsetDefinitionConfigName( $definitionConfigName) : \Zend_Db_Table_Abstract
inherited

setDefinitionConfigName()

Inherited from: \Zend_Db_Table_Abstract::setDefinitionConfigName()
Parameters
NameTypeDescription
$definitionConfigName
Returns
TypeDescription
\Zend_Db_Table_Abstract
methodpublicsetDependentTables(array $dependentTables) : \Zend_Db_Table_Abstract
Parameters
NameTypeDescription
$dependentTablesarray
Returns
TypeDescription
\Zend_Db_Table_AbstractProvides a fluent interface
methodpublicsetLifetime(int $lifetime, boolean $overrideLifetime = null) : \Zend_Session_SaveHandler_DbTable

Set session lifetime and optional whether or not the lifetime of an existing session should be overridden

$lifetime === false resets lifetime to session.gc_maxlifetime

Parameters
NameTypeDescription
$lifetimeint
$overrideLifetimeboolean

(optional)

Returns
TypeDescription
\Zend_Session_SaveHandler_DbTable
methodpublicsetMetadataCacheInClass(bool $flag) : \Zend_Db_Table_Abstract
inherited

Indicate whether metadata should be cached in the class for the duration of the instance

Inherited from: \Zend_Db_Table_Abstract::setMetadataCacheInClass()
Parameters
NameTypeDescription
$flagbool
Returns
TypeDescription
\Zend_Db_Table_Abstract
methodpublicsetOptions(array $options) : \Zend_Db_Table_Abstract
inherited

setOptions()

Inherited from: \Zend_Db_Table_Abstract::setOptions()
Parameters
NameTypeDescription
$optionsarray
Returns
TypeDescription
\Zend_Db_Table_Abstract
methodpublicsetOverrideLifetime(boolean $overrideLifetime) : \Zend_Session_SaveHandler_DbTable

Set whether or not the lifetime of an existing session should be overridden

Parameters
NameTypeDescription
$overrideLifetimeboolean
Returns
TypeDescription
\Zend_Session_SaveHandler_DbTable
methodpublicsetReferences(array $referenceMap) : \Zend_Db_Table_Abstract
Parameters
NameTypeDescription
$referenceMaparray
Returns
TypeDescription
\Zend_Db_Table_AbstractProvides a fluent interface
methodpublicsetRowClass(string $classname) : \Zend_Db_Table_Abstract
Parameters
NameTypeDescription
$classnamestring
Returns
TypeDescription
\Zend_Db_Table_AbstractProvides a fluent interface
methodpublicsetRowsetClass(string $classname) : \Zend_Db_Table_Abstract
Parameters
NameTypeDescription
$classnamestring
Returns
TypeDescription
\Zend_Db_Table_AbstractProvides a fluent interface
methodpublicupdate(array $data, array | string $where) : int
inherited

Updates existing rows.

Inherited from: \Zend_Db_Table_Abstract::update()
Parameters
NameTypeDescription
$dataarray

Column-value pairs.

$wherearray | string

An SQL WHERE clause, or an array of SQL WHERE clauses.

Returns
TypeDescription
intThe number of rows updated.
methodpublicwrite(string $id, string $data) : boolean

Write session data

Parameters
NameTypeDescription
$idstring
$datastring
Returns
TypeDescription
boolean
Documentation was generated by phpDocumentor 2.0.0a12.