API Documentation

Db/Table/Row/Abstract.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Db
subpackage
Table
version
$Id: Abstract.php 22230 2010-05-21 20:59:18Z ralph $
Classes
Zend_Db_Table_Row_Abstract

Description

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.

Zend_Db_Table_Row_Abstract

Implements
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Db
subpackage
Table
Properties
$_data
$_cleanData
$_modifiedFields
$_table
$_connected
$_readOnly
$_tableClass
$_primary
Methods
__construct
_transformColumn
__get
__set
__unset
__isset
__sleep
__wakeup
offsetExists
offsetGet
offsetSet
offsetUnset
init
getTable
setTable
getTableClass
isConnected
isReadOnly
setReadOnly
select
save
_doInsert
_doUpdate
delete
getIterator
toArray
setFromArray
refresh
_getTable
_getPrimaryKey
_getWhereQuery
_refresh
_insert
_postInsert
_update
_postUpdate
_delete
_postDelete
_prepareReference
findDependentRowset
findParentRow
findManyToManyRowset
__call
_getTableFromString

Description

Properties

$_cleanData

array $_cleanData = 'array'

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().

Details

$_cleanData
array
visibility
protected
default
array
final
false
static
false

$_connected

boolean $_connected = 'true'

Connected is true if we have a reference to a live Zend_Db_Table_Abstract object.

This is false after the Rowset has been deserialized.

Details

$_connected
boolean
visibility
protected
default
true
final
false
static
false

$_data

array $_data = 'array'

The data for each column in the row (column_name => value).

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

Details

$_data
array
visibility
protected
default
array
final
false
static
false

$_modifiedFields

array $_modifiedFields = 'array'

Tracks columns where data has been updated. Allows more specific insert and update operations.

Details

$_modifiedFields
array
visibility
protected
default
array
final
false
static
false

$_primary

array $_primary = ''

Primary row key(s).

Details

$_primary
array
visibility
protected
default
final
false
static
false

$_readOnly

boolean $_readOnly = 'false'

A row is marked read only if it contains columns that are not physically represented within the database schema (e.g. evaluated columns/Zend_Db_Expr columns). This can also be passed as a run-time config options as a means of protecting row data.

Details

$_readOnly
boolean
visibility
protected
default
false
final
false
static
false

$_table

Zend_Db_Table_Abstract $_table = 'null'

Zend_Db_Table_Abstract parent class or instance.

Details

$_table
Zend_Db_Table_Abstract
visibility
protected
default
null
final
false
static
false

$_tableClass

string $_tableClass = 'null'

Name of the class of the Zend_Db_Table_Abstract object.

Details

$_tableClass
string
visibility
protected
default
null
final
false
static
false

Methods

__call

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

Arguments
$method
string
$args
array
OPTIONAL Zend_Db_Table_Select query modifier
Details
visibility
public
final
false
static
false
throws
If an invalid method is called.

__construct

__construct( array $config = array ) : void

Constructor.

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

Arguments
$config
array
OPTIONAL Array of user-specified config options.
Details
visibility
public
final
false
static
false
throws

__get

__get( string $columnName ) : string

Retrieve row field value

Arguments
$columnName
string
The user-specified column name.
Output
string
The corresponding column value.
Details
visibility
public
final
false
static
false
throws
if the $columnName is not a column in the row.

__isset

__isset( string $columnName ) : boolean

Test existence of row field

Arguments
$columnName
string
The column key.
Output
boolean
Details
visibility
public
final
false
static
false

__set

__set( string $columnName, mixed $value ) : void

Set row field value

Arguments
$columnName
string
The column key.
$value
mixed
The value for the property.
Details
visibility
public
final
false
static
false
throws

__sleep

__sleep( ) : array

Store table, primary key and data in serialized object

Output
array
Details
visibility
public
final
false
static
false

__unset

__unset( string $columnName ) : Zend_Db_Table_Row_Abstract

Unset row field value

Arguments
$columnName
string
The column key.
Details
visibility
public
final
false
static
false
throws

__wakeup

__wakeup( ) : void

Setup to do on wakeup.

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

Details
visibility
public
final
false
static
false

_delete

_delete( ) : void

Allows pre-delete logic to be applied to row.

Subclasses may override this method.

Details
visibility
protected
final
false
static
false

_doInsert

_doInsert( ) : mixed

Output
mixed
The primary key value(s), as an associative array if the key is compound, or a scalar if the key is single-column.
Details
visibility
protected
final
false
static
false

_doUpdate

_doUpdate( ) : mixed

Output
mixed
The primary key value(s), as an associative array if the key is compound, or a scalar if the key is single-column.
Details
visibility
protected
final
false
static
false

_getPrimaryKey

_getPrimaryKey( bool $useDirty = true ) : array

Retrieves an associative array of primary keys.

Arguments
$useDirty
bool
Output
array
Details
visibility
protected
final
false
static
false

_getTable

_getTable( ) : Zend_Db_Table_Abstract

Retrieves an instance of the parent table.

Details
visibility
protected
final
false
static
false

_getTableFromString

_getTableFromString( string $tableName ) : Zend_Db_Table_Abstract

_getTableFromString

Arguments
$tableName
string
Details
visibility
protected
final
false
static
false

_getWhereQuery

_getWhereQuery( bool $useDirty = true ) : array

Constructs where statement for retrieving row(s).

Arguments
$useDirty
bool
Output
array
Details
visibility
protected
final
false
static
false

_insert

_insert( ) : void

Allows pre-insert logic to be applied to row.

Subclasses may override this method.

Details
visibility
protected
final
false
static
false

_postDelete

_postDelete( ) : void

Allows post-delete logic to be applied to row.

Subclasses may override this method.

Details
visibility
protected
final
false
static
false

_postInsert

_postInsert( ) : void

Allows post-insert logic to be applied to row.

Subclasses may override this method.

Details
visibility
protected
final
false
static
false

_postUpdate

_postUpdate( ) : void

Allows post-update logic to be applied to row.

Subclasses may override this method.

Details
visibility
protected
final
false
static
false

_prepareReference

_prepareReference( Zend_Db_Table_Abstract $dependentTable, Zend_Db_Table_Abstract $parentTable, string $ruleKey ) : array

Prepares a table reference for lookup.

Ensures all reference keys are set and properly formatted.

Arguments
$dependentTable
Zend_Db_Table_Abstract
$parentTable
Zend_Db_Table_Abstract
$ruleKey
string
Output
array
Details
visibility
protected
final
false
static
false

_refresh

_refresh( ) : void

Refreshes properties from the database.

Details
visibility
protected
final
false
static
false

_transformColumn

_transformColumn( string $columnName ) : string

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

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

Arguments
$columnName
string
Column name given.
Output
string
The column name after transformation applied (none by default).
Details
visibility
protected
final
false
static
false
throws
if the $columnName is not a string.

_update

_update( ) : void

Allows pre-update logic to be applied to row.

Subclasses may override this method.

Details
visibility
protected
final
false
static
false

delete

delete( ) : int

Deletes existing rows.

Output
int
The number of rows deleted.
Details
visibility
public
final
false
static
false

findDependentRowset

findDependentRowset( 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.

Arguments
$dependentTable
stringZend_Db_Table_Abstract
$ruleKey
string
OPTIONAL $ruleKey
$select
Zend_Db_Table_Select
OPTIONAL $select
Output
Zend_Db_Table_Rowset_Abstract
Query result from $dependentTable
Details
visibility
public
final
false
static
false
throws
If $dependentTable is not a table or is not loadable.

findManyToManyRowset

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

Arguments
$matchTable
stringZend_Db_Table_Abstract
$intersectionTable
stringZend_Db_Table_Abstract
$callerRefRule
string
OPTIONAL $callerRefRule
$matchRefRule
string
OPTIONAL $matchRefRule
$select
Zend_Db_Table_Select
OPTIONAL $select
Output
Zend_Db_Table_Rowset_Abstract
Query result from $matchTable
Details
visibility
public
final
false
static
false
throws
If $matchTable or $intersectionTable is not a table class or is not loadable.

findParentRow

findParentRow( 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.

Arguments
$parentTable
stringZend_Db_Table_Abstract
$ruleKey
string
OPTIONAL $ruleKey
$select
Zend_Db_Table_Select
OPTIONAL $select
Output
Zend_Db_Table_Row_Abstract
Query result from $parentTable
Details
visibility
public
final
false
static
false
throws
If $parentTable is not a table or is not loadable.

getIterator

getIterator( ) :
Details
visibility
public
final
false
static
false

getTable

getTable( ) : Zend_Db_Table_Abstract|null

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

Details
visibility
public
final
false
static
false

getTableClass

getTableClass( ) : string

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

Output
string
Details
visibility
public
final
false
static
false

init

init( ) : void

Initialize object

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

Details
visibility
public
final
false
static
false

isConnected

isConnected( ) : boolean

Test the connected status of the row.

Output
boolean
Details
visibility
public
final
false
static
false

isReadOnly

isReadOnly( ) : boolean

Test the read-only status of the row.

Output
boolean
Details
visibility
public
final
false
static
false

offsetExists

offsetExists( string $offset ) : boolean

Proxy to __isset Required by the ArrayAccess implementation

Arguments
$offset
string
Output
boolean
Details
visibility
public
final
false
static
false

offsetGet

offsetGet( string $offset ) : string

Proxy to __get Required by the ArrayAccess implementation

Arguments
$offset
string
Output
string
Details
visibility
public
final
false
static
false

offsetSet

offsetSet( string $offset, mixed $value ) :

Proxy to __set Required by the ArrayAccess implementation

Arguments
$offset
string
$value
mixed
Details
visibility
public
final
false
static
false

offsetUnset

offsetUnset( string $offset ) :

Proxy to __unset Required by the ArrayAccess implementation

Arguments
$offset
string
Details
visibility
public
final
false
static
false

refresh

refresh( ) : void

Refreshes properties from the database.

Details
visibility
public
final
false
static
false

save

save( ) : mixed

Saves the properties to the database.

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

Output
mixed
The primary key value(s), as an associative array if the key is compound, or a scalar if the key is single-column.
Details
visibility
public
final
false
static
false

select

select( ) : Zend_Db_Table_Select

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

Details
visibility
public
final
false
static
false

setFromArray

setFromArray( array $data ) : Zend_Db_Table_Row_Abstract

Sets all data in the row from an array.

Arguments
$data
array
Output
Zend_Db_Table_Row_Abstract
Provides a fluent interface
Details
visibility
public
final
false
static
false

setReadOnly

setReadOnly( boolean $flag ) : boolean

Set the read-only status of the row.

Arguments
$flag
boolean
Output
boolean
Details
visibility
public
final
false
static
false

setTable

setTable( 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.

Arguments
$table
Zend_Db_Table_Abstract
Output
boolean
Details
visibility
public
final
false
static
false
throws

toArray

toArray( ) : array

Returns the column/value data as an array.

Output
array
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.