Zikula: A Flexible Open Source Content Management System
home | forum | international support | contact us

Docs For Class PNObject

Class: PNObject

Source Location: /pnobjlib/PNObject.class.php

Class Overview


PNObjectUtil

Variables

Methods


Child classes:

PNObjectArray
PNObjectArrayUtil

Inherited Variables

Inherited Methods


Class Details

[line 20] PNObjectUtil



[ Top ]

Class Variables

$_columns =

[line 39]



Type:   mixed
[ Top ]

$_GET_FROM_DB =  'D'

[line 42]



Type:   mixed
[ Top ]

$_GET_FROM_GET =  'G'

[line 43]



Type:   mixed
[ Top ]

$_GET_FROM_POST =  'P'

[line 44]



Type:   mixed
[ Top ]

$_GET_FROM_REQUEST =  'R'

[line 45]



Type:   mixed
[ Top ]

$_GET_FROM_SESSION =  'S'

[line 46]



Type:   mixed
[ Top ]

$_GET_FROM_VALIDATION_FAILED =  'V'

[line 47]



Type:   mixed
[ Top ]

$_objColumnArray =

[line 35]



Type:   mixed
[ Top ]

$_objData =

[line 29]



Type:   mixed
[ Top ]

$_objField =

[line 30]



Type:   mixed
[ Top ]

$_objJoin =

[line 25]



Type:   mixed
[ Top ]

$_objKey =

[line 31]



Type:   mixed
[ Top ]

$_objPath =

[line 32]



Type:   mixed
[ Top ]

$_objPermissionFilter =

[line 34]



Type:   mixed
[ Top ]

$_objSessionPath =

[line 33]



Type:   mixed
[ Top ]

$_objType =

[line 24]



Type:   mixed
[ Top ]

$_objValidation =

[line 26]



Type:   mixed
[ Top ]

$_table =

[line 38]



Type:   mixed
[ Top ]

Class Methods


constructor PNObject [line 57]

PNObject PNObject( [init $init = null], [key $key = null], [field $field = null])

Constructur, init everything to sane defaults and handle parameters





Parameters:

init   $init   Initialization value (see _init() for details)
key   $key   The DB key to use to retrieve the object (optional) (default=null)
field   $field   The field containing the key value (optional) (default=null)

[ Top ]

method clearFailedValidationData [line 700]

void clearFailedValidationData( )

Clear the failed validation object data for this object





[ Top ]

method clearSessionCache [line 709]

void clearSessionCache( )

Clear the session cache for this object





[ Top ]

method clearValidationErrors [line 691]

void clearValidationErrors( )

Clear the failed validation errors for this object





[ Top ]

method delete [line 597]

The delete( )

Generic delete handler for an object



Tags:

return:  Object Data


Overridden in child classes as:

PNObjectArray::delete()
Generic delete handler for an object

[ Top ]

method deletePostProcess [line 624]

void deletePostProcess( [ $data = null])

Post-Process the data after a delete. Subclasses can define appropriate implementations.





Parameters:

   $data  

[ Top ]

method deletePreProcess [line 615]

void deletePreProcess( [ $data = null])

Pre-Process the data prior a delete. Subclasses can define appropriate implementations.





Parameters:

   $data  

[ Top ]

method generateEmptyObject [line 137]

void generateEmptyObject( )

Generate an empty object with the fields initialized to null





[ Top ]

method get [line 186]

The &get( key $key, [field $field = 'id'], [force $force = false])

Return the current object data. If $key and $field are supplied, the object is fetched again from the database.



Tags:

return:  object's data value


Overridden in child classes as:

PNObjectArray::get()
Return the current object data. Maps to $this->getWhere().

Parameters:

key   $key   The record's key value
field   $field   The field we wish to get (optional) (default='id')
force   $force   If false, the system attempts to return the object from the session cache (optional) (default=false) (currently not used)

[ Top ]

method getData [line 201]

The getData( )

Return the currently set object data



Tags:

return:  object's data array


Overridden in child classes as:

PNObjectArray::getData()
Return the currently set object data

[ Top ]

method getDataField [line 476]

The getDataField( key $key, [default $default = null])

Generic function to retrieve



Tags:

return:  Object Data


Overridden in child classes as:

PNObjectArray::getDataField()
Generic function to retrieve

Parameters:

key   $key   The access key of the object field
default   $default   The default value to return (optional) (default=null)

[ Top ]

method getDataFromInput [line 346]

The &getDataFromInput( [key $key = null], [default $default = null], [source $source = 'REQUEST'])

Get the data from the various input streams provided.



Tags:

return:  requested object/value


Parameters:

key   $key   The access key of the object (optional) (default=null, reverts to $this->_objPath)
default   $default   The default value to return (optional) (default=null)
source   $source   Where to get the variable from (optional) (default='REQUEST')

[ Top ]

method getDataFromInputPostProcess [line 423]

void getDataFromInputPostProcess( [ $data = null])

Post-Process the data after getting it from Input. Subclasses can define appropriate implementations.





Parameters:

   $data  

[ Top ]

method getDataFromSession [line 373]

The &getDataFromSession( [key $key = null], [default $default = null], [source $path = ''], [ $autocreate = true], [ $overwriteExistingVar = false])

Get the data from the various input streams provided.



Tags:

return:  requested object/value


Parameters:

key   $key   The access key of the object (optional) (default=null, reverts to $this->_objPath)
default   $default   The default value to return (optional) (default=null)
source   $path   Where to get the variable from (optional) (default=null)
   $autocreate  
   $overwriteExistingVar  

[ Top ]

method getDataFromSessionPostProcess [line 431]

void getDataFromSessionPostProcess( [ $data = null])

Post-Process the data after getting it from Session. Subclasses can define appropriate implementations.





Parameters:

   $data  

[ Top ]

method getDataFromSource [line 454]

The getDataFromSource( source $source, [key $key = null], [default $default = null], [clean $clean = true])

Generic access function to retrieve data from the specified source



Tags:

return:  requested object/value


Parameters:

source   $source   The source data
key   $key   The access key of the object (optional) (default=null)
default   $default   The default value to return (optional) (default=null)
clean   $clean   Whether or not to clean the acquired data (optional) (default=true)

[ Top ]

method getFailedValidationData [line 251]

The &getFailedValidationData( )

Get the object which failed validation



Tags:

return:  object's data value


[ Top ]

method getHash [line 673]

void getHash( [ $includeStandardFields = true], [ $objData = null])

Get the hashcode for this object data





Overridden in child classes as:

PNObjectArray::getHash()
Get the hashcode for this object data array

Parameters:

   $includeStandardFields  
   $objData  

[ Top ]

method getID [line 223]

The getID( )

Return the object-ID or false



Tags:

return:  object-ID or false


[ Top ]

method getIDField [line 212]

The getIDField( )

Return the object ID field name



Tags:

return:  object's ID field name


[ Top ]

method getValidation [line 630]

void getValidation( )





[ Top ]

method getWhere [line 240]

The &getWhere( where $where)

Return/Select the object using the given where clause.



Tags:

return:  object's data value


Overridden in child classes as:

PNObjectArray::getWhere()
Return/Select the object using the given where clause.

Parameters:

where   $where   The where-clause to use

[ Top ]

method hasID [line 264]

Boolean hasID( )

Return whether or not this object has a set id field





[ Top ]

method insert [line 527]

The insert( )

Generic insert handler for an object (ID is inserted into the object data)



Tags:

return:  Object Data


Overridden in child classes as:

PNObjectArray::insert()
Generic insert handler for an object (ID is inserted into the object data)

[ Top ]

method insertPostProcess [line 551]

void insertPostProcess( [ $data = null])

Post-Process the data after an insert. Subclasses can define appropriate implementations.





Parameters:

   $data  

[ Top ]

method insertPreProcess [line 543]

void insertPreProcess( [ $data = null])

Pre-Process the data prior to an insert. Subclasses can define appropriate implementations.





Parameters:

   $data  

[ Top ]

method prayer [line 718]

void prayer( )

Print HTML-formatted debug output for the object





[ Top ]

method prayerData [line 727]

void prayerData( )

Print HTML-formatted debug output for the object data





[ Top ]

method save [line 510]

The save( )

Generic insert handler for an object (ID is inserted into the object data). If the object contains a valid ID, it is updated, otherwise it it inserted



Tags:

return:  result set


Overridden in child classes as:

PNObjectArray::save()
Save an object - if it has an ID update it, otherwise insert it

[ Top ]

method select [line 279]

The &select( key $key, [field $field = 'id'], [where $where = ''])

Select the object from the database using the specified key (and field)



Tags:

return:  object's data value


Overridden in child classes as:

PNObjectArray::select()
Generic select handler for an object. Select (and set) the specified object array

Parameters:

key   $key   The record's key value (if init is a string directive)
field   $field   The key-field we wish to select by (optional) (default='id')
where   $where   The key-field we wish to select by (optional) (default='id')

[ Top ]

method selectPostProcess [line 332]

The selectPostProcess( [obj $obj = null])

Post-Process the newly selected object. Subclasses can define appropriate implementations.



Tags:

return:  object's data value


Overridden in child classes as:

PNObjectArray::selectPostProcess()
Iterate over the object data and post-process it

Parameters:

obj   $obj   Override object (needed for selectObjectArray processing) (optional) (default=null)

[ Top ]

method setData [line 161]

void setData( data $data, [cache $cache = true])

Set (and return) the object data.





Overridden in child classes as:

PNObjectArray::setData()
Set (and return) the object data. Since we dont' have a definitive key, we don't cache

Parameters:

data   $data   The data to assign
cache   $cache   Whether or not to cache the data in session (optional) (default=true)

[ Top ]

method setDataField [line 495]

The setDataField( key $key, value $value)

Generic function to retrieve



Tags:

return:  value which was set into the specified object field


Parameters:

key   $key   The access key of the object field
value   $value   The value to assign to the specified object field

[ Top ]

method setDataToSession [line 401]

The &setDataToSession( [autocreate $data = null], [overwriteExistingVar $key = null], [ $path = ''], [ $autocreate = true], [ $overwriteExistingVar = false])

Set the current object data into session



Tags:

return:  session data


Parameters:

autocreate   $data   The autocreate passed to SessionUtil::setVar
overwriteExistingVar   $key   The overwriteExistingVar variable passed to SessionUtil::setVar
   $path  
   $autocreate  
   $overwriteExistingVar  

[ Top ]

method setDataToSessionPreProcess [line 439]

void setDataToSessionPreProcess( [ $data = null])

Pre-Process the data before writing it to Session. Subclasses can define appropriate implementations.





Parameters:

   $data  

[ Top ]

method update [line 561]

The update( )

Generic upate handler for an object



Tags:

return:  Object Data


Overridden in child classes as:

PNObjectArray::update()
Generic upate handler for an object

[ Top ]

method updatePostProcess [line 586]

void updatePostProcess( [ $data = null])

Post-Process the data after an update. Subclasses can define appropriate implementations.





Parameters:

   $data  

[ Top ]

method updatePreProcess [line 577]

void updatePreProcess( [ $data = null])

Pre-Process the data prior to an update. Subclasses can define appropriate implementations.





Parameters:

   $data  

[ Top ]

method validate [line 641]

Boolean validate( )

Generic function to validate an object



Tags:

return:  indicating whether validation has passed or failed


Overridden in child classes as:

PNObjectArray::validate()
Constructur, init everything to sane defaults and handle parameters

[ Top ]

method validatePostProcess [line 663]

void validatePostProcess( [ $type = 'user'])

Post-Process the basic object validation with class specific logic.

Subclasses can define appropriate implementations.






Parameters:

   $type  

[ Top ]

method _init [line 85]

void _init( [init $init = null], [key $key = null], [field $field = null])

Internal intialization routine





Overridden in child classes as:

PNObjectArray::_init()
Internal intialization routine

Parameters:

init   $init   Initialization value (can be an object or a string directive)
key   $key   The DB key to use to retrieve the object (optional) (default=null)
field   $field  

The field containing the key value (optional) (default=null)

If $_init is an arrary it is set(), otherwise it is interpreted as a string specifying the source from where the data should be retrieved from.


[ Top ]

Packages:

Files:

Classes: