wasp.db
[ class tree: wasp.db ] [ index: wasp.db ] [ all elements ]

Class: DataObjectWrapper

Source Location: /db/DataObjectWrapper.php

Class Overview

PEAR
   |
   --DataObjectWrapper

Created on Feb 9, 2005


Author(s):

  • brian.fioca@pangomedia.com

Variables

Methods


Child classes:

HistoricalDataObjectWrapper
Created on Mar 1, 2005

Class Details

[line 37]
Created on Feb 9, 2005

DataObjectWrapper

Abstract wrapper Entity Objects which handles all data-tier processes. Subclass DataObjectWrapper to provide business layer abstraction all relevent business methods into the subclass object. This class should remain as generic as possible.




Tags:

abstract:  
author:  brian.fioca@pangomedia.com


[ Top ]


Class Variables

$_oDataObject =

[line 46]

Wrapped DB_DataObject



Tags:

access:  public

Type:   mixed


[ Top ]

$_stOrderBy =  null

[line 43]



Tags:

access:  protected

Type:   mixed


[ Top ]

$_stPrimaryKey =  'abstract_id'

[line 42]

NOTE - Subclasses MUST override this property



Tags:

access:  protected

Type:   mixed


[ Top ]

$_stTableName =  'abstract_table'

[line 40]

NOTE - Subclasses MUST override this property



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 53]

DataObjectWrapper __construct( [mixed $iId = null])

Constructor Initialize the data object using the table name specified in the subclass.



[ Top ]

method checkSecurityCriteria [line 67]

void checkSecurityCriteria( )



Tags:

access:  protected


[ Top ]

method delete [line 328]

void delete( )

Deletes the DataObject Entity corresponding to this wrapper.

Visibility is protected to force subclasses to decide whether or not they want to provide access to deletion.




Tags:

access:  protected


[ Top ]

method fillFromRequest [line 161]

void fillFromRequest( )

Use this method to auto provision the db object from request data.

This method looks for parameters in the request (form fields) that are named exactly like database field names, and uses them to populate the data object wrapper using it's own getters and setters

Example:

 $oPerson = new PersonWrapper();
 $oPerson->fillFromRequest();




Tags:

access:  public


[ Top ]

method find [line 82]

void find( )



Tags:

access:  public


[ Top ]

method findAll [line 102]

void findAll( )

Initializes the underlying data object to iterate over all data

for this entity in the database. Iterate over the results by calling next();




Tags:

access:  public


[ Top ]

method getForId [line 76]

void getForId( $iId $iId)

Loads the underlying DataObject for its id.



Tags:

access:  public


Parameters:

$iId   $iId   Primary key of this object

[ Top ]

method getId [line 134]

Returns getId( )

Get the primary key for this data object.



Tags:

return:  the primary key ID or null if not set
access:  public


[ Top ]

method getMultiFromRequest [line 221]

void getMultiFromRequest( )

UNDER DEVELOPMENT



Tags:

access:  public


[ Top ]

method getNameField [line 204]

void getNameField( )



Tags:

access:  public


[ Top ]

method handleErrors [line 282]

void handleErrors( mixed $error)



Tags:

access:  public


[ Top ]

method makeBumpCase [line 336]

void makeBumpCase( mixed $stString)



Tags:

access:  protected


[ Top ]

method makeSelectOptions [line 192]

void makeSelectOptions( [mixed $arSelectOptions = array()])

Uses the implied



Tags:

access:  public


[ Top ]

method next [line 121]

void next( )

Loads the data object with the next logical entity from the database.

Returns false if there are no more entities to traverse.




Tags:

access:  public


[ Top ]

method save [line 293]

void save( )

Saves the DataObjectWrapper



Tags:

access:  public


Overridden in child classes as:

HistoricalDataObjectWrapper::save()
Saves the HistoricalDataObjectWrapper in an historically friendly way

[ Top ]

method toArray [line 244]

void toArray( )

Use this method to populate page elements or template placeholders with data from this object.

Example:

 from inside a page/chunk
 $this->setFormElements($oPerson->toArray());
 or
 $this->setPlaceholders($oPerson->toArray());




Tags:

access:  public


[ Top ]

method validateSave [line 275]

void validateSave( )

Method used to validate business logic prior to saving.



Tags:

access:  public


[ Top ]


Documentation generated on Sun, 27 Nov 2005 13:15:47 -0500 by phpDocumentor 1.3.0RC3