Db/Table/Row.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-web at 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_Db  
Subpackage
Table  
Version
$Id: Row.php 24593 2012-01-05 20:35:02Z matthew $  

\Zend_Db_Table_Row

Package: Zend\Db\Table
Reference concrete class that extends Zend_Db_Table_Row_Abstract.

Developers may also create their own classes that extend the abstract class.

Parent(s)
\Zend_Db_Table_Row_Abstract
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertyprotectedarray $_cleanData = array()
inherited
This is set to a copy of $_data when the data is fetched from a database, specified as a new tuple in the constructor, or when dirty data is posted to the database with save().
Inherited from: \Zend_Db_Table_Row_Abstract::$$_cleanData
Default valuearray()Details
Type
array
Inherited_from
\Zend_Db_Table_Row_Abstract::$$_cleanData  
>VPropertyprotectedboolean $_connected = true
inherited
Connected is true if we have a reference to a live Zend_Db_Table_Abstract object.
Inherited from: \Zend_Db_Table_Row_Abstract::$$_connected

This is false after the Rowset has been deserialized.

Default valuetrueDetails
Type
boolean
Inherited_from
\Zend_Db_Table_Row_Abstract::$$_connected  
>VPropertyprotectedarray $_data = array()
inherited
The data for each column in the row (column_name => value).
Inherited from: \Zend_Db_Table_Row_Abstract::$$_data

The keys must match the physical names of columns in the table for which this row is defined.

Default valuearray()Details
Type
array
Inherited_from
\Zend_Db_Table_Row_Abstract::$$_data  
>VPropertyprotectedarray $_modifiedFields = array()
inherited
Tracks columns where data has been updated.
Inherited from: \Zend_Db_Table_Row_Abstract::$$_modifiedFields

Allows more specific insert and update operations.

Default valuearray()Details
Type
array
Inherited_from
\Zend_Db_Table_Row_Abstract::$$_modifiedFields  
>VPropertyprotectedarray $_primary
inherited
Primary row key(s).
Inherited from: \Zend_Db_Table_Row_Abstract::$$_primary
Details
Type
array
Inherited_from
\Zend_Db_Table_Row_Abstract::$$_primary  
>VPropertyprotectedboolean $_readOnly = false
inherited
A row is marked read only if it contains columns that are not physically represented within the database schema (e.g.
Inherited from: \Zend_Db_Table_Row_Abstract::$$_readOnly

evaluated columns/Zend_Db_Expr columns). This can also be passed as a run-time config options as a means of protecting row data.

Default valuefalseDetails
Type
boolean
Inherited_from
\Zend_Db_Table_Row_Abstract::$$_readOnly  
>VPropertyprotected\Zend_Db_Table_Abstract $_table = null
inherited
Zend_Db_Table_Abstract parent class or instance.
Inherited from: \Zend_Db_Table_Row_Abstract::$$_table
Default valuenullDetails
Type
\Zend_Db_Table_Abstract
Inherited_from
\Zend_Db_Table_Row_Abstract::$$_table  
>VPropertyprotectedstring $_tableClass = null
inherited
Name of the class of the Zend_Db_Table_Abstract object.
Inherited from: \Zend_Db_Table_Row_Abstract::$$_tableClass
Default valuenullDetails
Type
string
Inherited_from
\Zend_Db_Table_Row_Abstract::$$_tableClass  

Methods

methodpublic__call(string $method, array $args) : \Zend_Db_Table_Row_Abstract | \Zend_Db_Table_Rowset_Abstract
inherited

Turn magic function calls into non-magic function calls to the above methods.

Inherited from: \Zend_Db_Table_Row_Abstract::__call()
Parameters
NameTypeDescription
$methodstring
$argsarray

OPTIONAL Zend_Db_Table_Select query modifier

Returns
TypeDescription
\Zend_Db_Table_Row_Abstract | \Zend_Db_Table_Rowset_Abstract
Throws
ExceptionDescription
\Zend_Db_Table_Row_ExceptionIf an invalid method is called.
methodpublic__construct(array $config = array()) : void
inherited

Constructor.

Inherited from: \Zend_Db_Table_Row_Abstract::__construct()

Supported params for $config are:- - table = class name or object of type Zend_Db_Table_Abstract - data = values of columns in this row.

Parameters
NameTypeDescription
$configarray

OPTIONAL Array of user-specified config options.

Throws
ExceptionDescription
\Zend_Db_Table_Row_Exception
methodpublic__get(string $columnName) : string
inherited

Retrieve row field value

Inherited from: \Zend_Db_Table_Row_Abstract::__get()
Parameters
NameTypeDescription
$columnNamestring

The user-specified column name.

Returns
TypeDescription
stringThe corresponding column value.
Throws
ExceptionDescription
\Zend_Db_Table_Row_Exceptionif the $columnName is not a column in the row.
methodpublic__isset(string $columnName) : boolean
inherited

Test existence of row field

Inherited from: \Zend_Db_Table_Row_Abstract::__isset()
Parameters
NameTypeDescription
$columnNamestring

The column key.

Returns
TypeDescription
boolean
methodpublic__set(string $columnName, mixed $value) : void
inherited

Set row field value

Inherited from: \Zend_Db_Table_Row_Abstract::__set()
Parameters
NameTypeDescription
$columnNamestring

The column key.

$valuemixed

The value for the property.

Throws
ExceptionDescription
\Zend_Db_Table_Row_Exception
methodpublic__sleep() : array
inherited

Store table, primary key and data in serialized object

Inherited from: \Zend_Db_Table_Row_Abstract::__sleep()
Returns
TypeDescription
array
methodpublic__unset(string $columnName) : \Zend_Db_Table_Row_Abstract
inherited

Unset row field value

Inherited from: \Zend_Db_Table_Row_Abstract::__unset()
Parameters
NameTypeDescription
$columnNamestring

The column key.

Returns
TypeDescription
\Zend_Db_Table_Row_Abstract
Throws
ExceptionDescription
\Zend_Db_Table_Row_Exception
methodpublic__wakeup() : void
inherited

Setup to do on wakeup.

Inherited from: \Zend_Db_Table_Row_Abstract::__wakeup()

A de-serialized Row should not be assumed to have access to a live database connection, so set _connected = false.

methodprotected_delete() : void
inherited

Allows pre-delete logic to be applied to row.

Inherited from: \Zend_Db_Table_Row_Abstract::_delete()

Subclasses may override this method.

methodprotected_doInsert() : mixed
Returns
TypeDescription
mixedThe primary key value(s), as an associative array if the key is compound, or a scalar if the key is single-column.
methodprotected_doUpdate() : mixed
Returns
TypeDescription
mixedThe primary key value(s), as an associative array if the key is compound, or a scalar if the key is single-column.
methodprotected_getPrimaryKey(bool $useDirty = true) : array
inherited

Retrieves an associative array of primary keys.

Inherited from: \Zend_Db_Table_Row_Abstract::_getPrimaryKey()
Parameters
NameTypeDescription
$useDirtybool
Returns
TypeDescription
array
methodprotected_getTable() : \Zend_Db_Table_Abstract
inherited

Retrieves an instance of the parent table.

Inherited from: \Zend_Db_Table_Row_Abstract::_getTable()
Returns
TypeDescription
\Zend_Db_Table_Abstract
methodprotected_getTableFromString(string $tableName) : \Zend_Db_Table_Abstract
inherited

_getTableFromString

Inherited from: \Zend_Db_Table_Row_Abstract::_getTableFromString()
Parameters
NameTypeDescription
$tableNamestring
Returns
TypeDescription
\Zend_Db_Table_Abstract
methodprotected_getWhereQuery(bool $useDirty = true) : array
inherited

Constructs where statement for retrieving row(s).

Inherited from: \Zend_Db_Table_Row_Abstract::_getWhereQuery()
Parameters
NameTypeDescription
$useDirtybool
Returns
TypeDescription
array
methodprotected_insert() : void
inherited

Allows pre-insert logic to be applied to row.

Inherited from: \Zend_Db_Table_Row_Abstract::_insert()

Subclasses may override this method.

methodprotected_postDelete() : void
inherited

Allows post-delete logic to be applied to row.

Inherited from: \Zend_Db_Table_Row_Abstract::_postDelete()

Subclasses may override this method.

methodprotected_postInsert() : void
inherited

Allows post-insert logic to be applied to row.

Inherited from: \Zend_Db_Table_Row_Abstract::_postInsert()

Subclasses may override this method.

methodprotected_postUpdate() : void
inherited

Allows post-update logic to be applied to row.

Inherited from: \Zend_Db_Table_Row_Abstract::_postUpdate()

Subclasses may override this method.

methodprotected_prepareReference(\Zend_Db_Table_Abstract $dependentTable, \Zend_Db_Table_Abstract $parentTable, string $ruleKey) : array
inherited

Prepares a table reference for lookup.

Inherited from: \Zend_Db_Table_Row_Abstract::_prepareReference()

Ensures all reference keys are set and properly formatted.

Parameters
NameTypeDescription
$dependentTable\Zend_Db_Table_Abstract
$parentTable\Zend_Db_Table_Abstract
$ruleKeystring
Returns
TypeDescription
array
methodprotected_refresh() : void
inherited

Refreshes properties from the database.

Inherited from: \Zend_Db_Table_Row_Abstract::_refresh()
methodprotected_transformColumn(string $columnName) : string
inherited

Transform a column name from the user-specified form to the physical form used in the database.

Inherited from: \Zend_Db_Table_Row_Abstract::_transformColumn()

You can override this method in a custom Row class to implement column name mappings, for example inflection.

Parameters
NameTypeDescription
$columnNamestring

Column name given.

Returns
TypeDescription
stringThe column name after transformation applied (none by default).
Throws
ExceptionDescription
\Zend_Db_Table_Row_Exceptionif the $columnName is not a string.
methodprotected_update() : void
inherited

Allows pre-update logic to be applied to row.

Inherited from: \Zend_Db_Table_Row_Abstract::_update()

Subclasses may override this method.

methodpublicdelete() : int
inherited

Deletes existing rows.

Inherited from: \Zend_Db_Table_Row_Abstract::delete()
Returns
TypeDescription
intThe number of rows deleted.
methodpublicfindDependentRowset(string | \Zend_Db_Table_Abstract $dependentTable, string $ruleKey = null, \Zend_Db_Table_Select $select = null) : \Zend_Db_Table_Rowset_Abstract
inherited

Query a dependent table to retrieve rows matching the current row.

Inherited from: \Zend_Db_Table_Row_Abstract::findDependentRowset()
Parameters
NameTypeDescription
$dependentTablestring | \Zend_Db_Table_Abstract
$ruleKeystring

OPTIONAL $ruleKey

$select\Zend_Db_Table_Select

OPTIONAL $select

Returns
TypeDescription
\Zend_Db_Table_Rowset_AbstractQuery result from $dependentTable
Throws
ExceptionDescription
\Zend_Db_Table_Row_ExceptionIf $dependentTable is not a table or is not loadable.
methodpublicfindManyToManyRowset(string | \Zend_Db_Table_Abstract $matchTable, string | \Zend_Db_Table_Abstract $intersectionTable, string $callerRefRule = null, string $matchRefRule = null, \Zend_Db_Table_Select $select = null) : \Zend_Db_Table_Rowset_Abstract
Parameters
NameTypeDescription
$matchTablestring | \Zend_Db_Table_Abstract
$intersectionTablestring | \Zend_Db_Table_Abstract
$callerRefRulestring

OPTIONAL $callerRefRule

$matchRefRulestring

OPTIONAL $matchRefRule

$select\Zend_Db_Table_Select

OPTIONAL $select

Returns
TypeDescription
\Zend_Db_Table_Rowset_AbstractQuery result from $matchTable
Throws
ExceptionDescription
\Zend_Db_Table_Row_ExceptionIf $matchTable or $intersectionTable is not a table class or is not loadable.
methodpublicfindParentRow(string | \Zend_Db_Table_Abstract $parentTable, string $ruleKey = null, \Zend_Db_Table_Select $select = null) : \Zend_Db_Table_Row_Abstract
inherited

Query a parent table to retrieve the single row matching the current row.

Inherited from: \Zend_Db_Table_Row_Abstract::findParentRow()
Parameters
NameTypeDescription
$parentTablestring | \Zend_Db_Table_Abstract
$ruleKeystring

OPTIONAL $ruleKey

$select\Zend_Db_Table_Select

OPTIONAL $select

Returns
TypeDescription
\Zend_Db_Table_Row_AbstractQuery result from $parentTable
Throws
ExceptionDescription
\Zend_Db_Table_Row_ExceptionIf $parentTable is not a table or is not loadable.
methodpublicgetIterator() : void
methodpublicgetPrimaryKey(bool $useDirty = true) : array
inherited

Retrieves an associative array of primary keys.

Inherited from: \Zend_Db_Table_Row_Abstract::getPrimaryKey()
Parameters
NameTypeDescription
$useDirtybool
Returns
TypeDescription
array
methodpublicgetTable() : \Zend_Db_Table_Abstract | null
inherited

Returns the table object, or null if this is disconnected row

Inherited from: \Zend_Db_Table_Row_Abstract::getTable()
Returns
TypeDescription
\Zend_Db_Table_Abstract | null
methodpublicgetTableClass() : string
inherited

Query the class name of the Table object for which this Row was created.

Inherited from: \Zend_Db_Table_Row_Abstract::getTableClass()
Returns
TypeDescription
string
methodpublicinit() : void
inherited

Initialize object

Inherited from: \Zend_Db_Table_Row_Abstract::init()

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

methodpublicisConnected() : boolean
inherited

Test the connected status of the row.

Inherited from: \Zend_Db_Table_Row_Abstract::isConnected()
Returns
TypeDescription
boolean
methodpublicisReadOnly() : boolean
inherited

Test the read-only status of the row.

Inherited from: \Zend_Db_Table_Row_Abstract::isReadOnly()
Returns
TypeDescription
boolean
methodpublicoffsetExists(string $offset) : boolean
inherited

Proxy to __isset Required by the ArrayAccess implementation

Inherited from: \Zend_Db_Table_Row_Abstract::offsetExists()
Parameters
NameTypeDescription
$offsetstring
Returns
TypeDescription
boolean
methodpublicoffsetGet(string $offset) : string
inherited

Proxy to __get Required by the ArrayAccess implementation

Inherited from: \Zend_Db_Table_Row_Abstract::offsetGet()
Parameters
NameTypeDescription
$offsetstring
Returns
TypeDescription
string
methodpublicoffsetSet(string $offset, mixed $value) : void
inherited

Proxy to __set Required by the ArrayAccess implementation

Inherited from: \Zend_Db_Table_Row_Abstract::offsetSet()
Parameters
NameTypeDescription
$offsetstring
$valuemixed
methodpublicoffsetUnset(string $offset) : void
inherited

Proxy to __unset Required by the ArrayAccess implementation

Inherited from: \Zend_Db_Table_Row_Abstract::offsetUnset()
Parameters
NameTypeDescription
$offsetstring
methodpublicrefresh() : void
inherited

Refreshes properties from the database.

Inherited from: \Zend_Db_Table_Row_Abstract::refresh()
methodpublicsave() : mixed
inherited

Saves the properties to the database.

Inherited from: \Zend_Db_Table_Row_Abstract::save()

This performs an intelligent insert/update, and reloads the properties with fresh data from the table on success.

Returns
TypeDescription
mixedThe primary key value(s), as an associative array if the key is compound, or a scalar if the key is single-column.
methodpublicselect() : \Zend_Db_Table_Select
inherited

Returns an instance of the parent table's Zend_Db_Table_Select object.

Inherited from: \Zend_Db_Table_Row_Abstract::select()
Returns
TypeDescription
\Zend_Db_Table_Select
methodpublicsetFromArray(array $data) : \Zend_Db_Table_Row_Abstract
inherited

Sets all data in the row from an array.

Inherited from: \Zend_Db_Table_Row_Abstract::setFromArray()
Parameters
NameTypeDescription
$dataarray
Returns
TypeDescription
\Zend_Db_Table_Row_AbstractProvides a fluent interface
methodpublicsetReadOnly(boolean $flag) : boolean
inherited

Set the read-only status of the row.

Inherited from: \Zend_Db_Table_Row_Abstract::setReadOnly()
Parameters
NameTypeDescription
$flagboolean
Returns
TypeDescription
boolean
methodpublicsetTable(\Zend_Db_Table_Abstract $table = null) : boolean
inherited

Set the table object, to re-establish a live connection to the database for a Row that has been de-serialized.

Inherited from: \Zend_Db_Table_Row_Abstract::setTable()
Parameters
NameTypeDescription
$table\Zend_Db_Table_Abstract
Returns
TypeDescription
boolean
Throws
ExceptionDescription
\Zend_Db_Table_Row_Exception
methodpublictoArray() : array
inherited

Returns the column/value data as an array.

Inherited from: \Zend_Db_Table_Row_Abstract::toArray()
Returns
TypeDescription
array
Documentation was generated by phpDocumentor 2.0.0a12.