API Documentation

Db/Table/Row.php

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-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Db  
subpackage
Table  
version
$Id: Row.php 23775 2011-03-01 17:25:24Z ralph $  

\Zend_Db_Table_Row

Reference concrete class that extends Zend_Db_Table_Row_Abstract.

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

Extends from
\Zend_Db_Table_Row_Abstract
category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Db  
subpackage
Table  

Methods

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

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

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

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

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

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

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

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

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

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

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

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

_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

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

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

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

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

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

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

Refreshes properties from the database.

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

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

Allows pre-update logic to be applied to row.

Inherited from: \Zend_Db_Table_Row_Abstract::_update()

Subclasses may override this method.

methodpublicdelete( ) : int

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

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

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
methodpublicgetTable( ) : \Zend_Db_Table_Abstract|null

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_Abstractnull
methodpublicgetTableClass( ) : string

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

Initialize object

Inherited from: \Zend_Db_Table_Row_Abstract::init()

Called from {@link __construct()} as final step of object instantiation.

methodpublicisConnected( ) : boolean

Test the connected status of the row.

Inherited from: \Zend_Db_Table_Row_Abstract::isConnected()
Returns
Type Description
boolean
methodpublicisReadOnly( ) : boolean

Test the read-only status of the row.

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

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

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

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

Proxy to __unset Required by the ArrayAccess implementation

Inherited from: \Zend_Db_Table_Row_Abstract::offsetUnset()
Parameters
Name Type Description
$offset string
methodpublicrefresh( ) : void

Refreshes properties from the database.

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

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

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

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

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

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

Returns the column/value data as an array.

Inherited from: \Zend_Db_Table_Row_Abstract::toArray()
Returns
Type Description
array
Documentation was generated by DocBlox 0.13.3.