Db/Table/Row.php

Show: inherited
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 [email protected] 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

Propertyprotectedarray $_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  
Propertyprotectedboolean $_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  
Propertyprotectedarray $_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  
Propertyprotectedarray $_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  
Propertyprotectedarray $_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  
Propertyprotectedboolean $_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  
Propertyprotected\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  
Propertyprotectedstring $_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
Name Type Description
$method string
$args array

OPTIONAL Zend_Db_Table_Select query modifier

Returns
Type Description
\Zend_Db_Table_Row_Abstract | \Zend_Db_Table_Rowset_Abstract
Throws
Exception Description
\Zend_Db_Table_Row_Exception If 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
Name Type Description
$config array

OPTIONAL Array of user-specified config options.

Throws
Exception Description
\Zend_Db_Table_Row_Exception
methodpublic__get(string $columnName) : string
inherited

Retrieve row field value

Inherited from: \Zend_Db_Table_Row_Abstract::__get()
Parameters
Name Type Description
$columnName string

The user-specified column name.

Returns
Type Description
string The corresponding column value.
Throws
Exception Description
\Zend_Db_Table_Row_Exception if 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
Name Type Description
$columnName string

The column key.

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

Set row field value

Inherited from: \Zend_Db_Table_Row_Abstract::__set()
Parameters
Name Type Description
$columnName string

The column key.

$value mixed

The value for the property.

Throws
Exception Description
\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
Type Description
array
methodpublic__unset(string $columnName) : \Zend_Db_Table_Row_Abstract
inherited

Unset row field value

Inherited from: \Zend_Db_Table_Row_Abstract::__unset()
Parameters
Name Type Description
$columnName string

The column key.

Returns
Type Description
\Zend_Db_Table_Row_Abstract
Throws
Exception Description
\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
inherited

Inherited from: \Zend_Db_Table_Row_Abstract::_doInsert()
Returns
Type Description
mixed The 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
inherited

Inherited from: \Zend_Db_Table_Row_Abstract::_doUpdate()
Returns
Type Description
mixed The 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
Name Type Description
$useDirty bool
Returns
Type Description
array
methodprotected_getTable() : \Zend_Db_Table_Abstract
inherited

Retrieves an instance of the parent table.

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

_getTableFromString

Inherited from: \Zend_Db_Table_Row_Abstract::_getTableFromString()
Parameters
Name Type Description
$tableName string
Returns
Type Description
\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
Name Type Description
$useDirty bool
Returns
Type Description
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
Name Type Description
$dependentTable \Zend_Db_Table_Abstract
$parentTable \Zend_Db_Table_Abstract
$ruleKey string
Returns
Type Description
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
Name Type Description
$columnName string

Column name given.

Returns
Type Description
string The column name after transformation applied (none by default).
Throws
Exception Description
\Zend_Db_Table_Row_Exception if 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
Type Description
int The 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
Name Type Description
$dependentTable string | \Zend_Db_Table_Abstract
$ruleKey string

OPTIONAL $ruleKey

$select \Zend_Db_Table_Select

OPTIONAL $select

Returns
Type Description
\Zend_Db_Table_Rowset_Abstract Query result from $dependentTable
Throws
Exception Description
\Zend_Db_Table_Row_Exception If $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
Name Type Description
$matchTable string | \Zend_Db_Table_Abstract
$intersectionTable string | \Zend_Db_Table_Abstract
$callerRefRule string

OPTIONAL $callerRefRule

$matchRefRule string

OPTIONAL $matchRefRule

$select \Zend_Db_Table_Select

OPTIONAL $select

Returns
Type Description
\Zend_Db_Table_Rowset_Abstract Query result from $matchTable
Throws
Exception Description
\Zend_Db_Table_Row_Exception If $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
Name Type Description
$parentTable string | \Zend_Db_Table_Abstract
$ruleKey string

OPTIONAL $ruleKey

$select \Zend_Db_Table_Select

OPTIONAL $select

Returns
Type Description
\Zend_Db_Table_Row_Abstract Query result from $parentTable
Throws
Exception Description
\Zend_Db_Table_Row_Exception If $parentTable is not a table or is not loadable.
methodpublicgetIterator() : void
inherited

Inherited from: \Zend_Db_Table_Row_Abstract::getIterator()
methodpublicgetPrimaryKey(bool $useDirty = true) : array
inherited

Retrieves an associative array of primary keys.

Inherited from: \Zend_Db_Table_Row_Abstract::getPrimaryKey()
Parameters
Name Type Description
$useDirty bool
Returns
Type Description
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
Type Description
\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
Type Description
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
Type Description
boolean
methodpublicisReadOnly() : boolean
inherited

Test the read-only status of the row.

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

Proxy to __isset Required by the ArrayAccess implementation

Inherited from: \Zend_Db_Table_Row_Abstract::offsetExists()
Parameters
Name Type Description
$offset string
Returns
Type Description
boolean
methodpublicoffsetGet(string $offset) : string
inherited

Proxy to __get Required by the ArrayAccess implementation

Inherited from: \Zend_Db_Table_Row_Abstract::offsetGet()
Parameters
Name Type Description
$offset string
Returns
Type Description
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
Name Type Description
$offset string
$value mixed
methodpublicoffsetUnset(string $offset) : void
inherited

Proxy to __unset Required by the ArrayAccess implementation

Inherited from: \Zend_Db_Table_Row_Abstract::offsetUnset()
Parameters
Name Type Description
$offset string
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
Type Description
mixed The 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
Type Description
\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
Name Type Description
$data array
Returns
Type Description
\Zend_Db_Table_Row_Abstract Provides 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
Name Type Description
$flag boolean
Returns
Type Description
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
Name Type Description
$table \Zend_Db_Table_Abstract
Returns
Type Description
boolean
Throws
Exception Description
\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
Type Description
array
Documentation was generated by phpDocumentor 2.0.0a8.