Class: IcmsPersistableObjectHandler

Source Location: /kernel/icmspersistableobjecthandler.php

Class IcmsPersistableObjectHandler

Class Overview

IcmsPersistableObjectHandler

This class is responsible for providing data access mechanisms to the data source of derived class objects as well as some basic operations inherant to objects manipulation

Located in /kernel/icmspersistableobjecthandler.php [line 22]

XoopsObjectHandler
   |
   --IcmsPersistableObjectHandler
Author(s): API Tags:
Filesource:  Source Code for this file

Information Tags:
Version:  $Id: icmspersistableobjecthandler.php 6931 2008-11-15 13:49:11Z pesian_stranger $
Copyright:  The ImpressCMS Project http://www.impresscms.org/
Since:  1.1
License:  GNU General Public License (GPL)

Properties

Methods

[ Top ]
Descendants
Child Class Description
SystemCustomtagHandler IcmsPersistableObjectHandler

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From XoopsObjectHandler

XoopsObjectHandler::$db

Inherited From XoopsObjectHandler

XoopsObjectHandler::XoopsObjectHandler()
called from child classes only
XoopsObjectHandler::create()
creates a new object
XoopsObjectHandler::delete()
delete object from database
XoopsObjectHandler::get()
gets a value object
XoopsObjectHandler::insert()
insert/update object

[ Top ]
Property Summary
string   $className   Name of the class derived from IcmsPersistableObject and which this handler is handling
array   $eventArray   Array containing the events name and functions
mixed   $generalSQL  
mixed   $highlightFields  
string   $identifierName   Name of the field which properly identify the IcmsPersistableObject
string   $keyName   Name of the table key that uniquely identify each IcmsPersistableObject
array   $permissionsArray   Array containing the permissions that this handler will manage on the objects
string   $summaryName   Name of the field which will be use as a summary for the object
string   $table   Name of the table use to store this IcmsPersistableObject
mixed   $_allowedMimeTypes  
mixed   $_disabledEvents  
mixed   $_eventHooks  
mixed   $_itemname  
mixed   $_maxFileSize  
mixed   $_maxHeight  
mixed   $_maxWidth  
mixed   $_moduleName  
string   $_modulePath   Full path of the module using this IcmsPersistableObject
mixed   $_moduleUrl  
string   $_page   Page name use to basically manage and display the IcmsPersistableObject
mixed   $_uploadPath  
mixed   $_uploadUrl  

[ Top ]
Method Summary
IcmsPersistableObjectHandler   IcmsPersistableObjectHandler()   Constructor - called from child classes
void   addEventHook()  
void   addPermission()   Add a permission that this handler will manage for its objects
array   convertResultSet()   Convert a database resultset to a returnable array
object {@link   &create()   create a new IcmsPersistableObject
bool   delete()   delete an object from the database
bool   deleteAll()   delete all objects meeting the conditions
void   disableEvent()  
mixed   executeEvent()   Execute the function associated with an event This method will check if the function is available
mixed   &get()   retrieve a IcmsPersistableObject
int   getCount()   count objects matching a condition
mixed   &getD()   retrieve a IcmsPersistableObject
void   getIdentifierName()  
void   getIdsFromObjectsAsArray()   Build an array containing all the ids of an array of objects as array
void   getImagePath()  
void   getImageUrl()  
array   getList()   Retrieve a list of objects as arrays - DON'T USE WITH JOINT KEYS
void   getListD()  
void   getModuleConfig()  
void   getModuleInfo()  
void   getModuleItemString()  
array   getObjects()   retrieve objects from the database
void   getObjectsAsArray()  
array   getObjectsD()   retrieve objects with debug mode - so will show the query
void   getPermissions()  
bool   insert()   insert a new object in the database
void   insertD()  
void   query()  
void   setGrantedObjectsCriteria()  
void   setUploaderConfig()  
bool   updateAll()   Change a value for objects with a certain criteria
void   updateCounter()  

[ Top ]
Properties
string   $className [line 51]

Name of the class derived from IcmsPersistableObject and which this handler is handling

Note that this string needs to be lowercase

For example : "smartsectioncategory"


[ Top ]
array   $eventArray = array() [line 112]

Array containing the events name and functions


[ Top ]
mixed   $generalSQL = false [line 121]

[ Top ]
mixed   $highlightFields = array() [line 105]

[ Top ]
string   $identifierName [line 59]

Name of the field which properly identify the IcmsPersistableObject

For example : "name" (this will be the category's name)


[ Top ]
string   $keyName [line 41]

Name of the table key that uniquely identify each IcmsPersistableObject

For example : "categoryid"


[ Top ]
array   $permissionsArray = false [line 119]

Array containing the permissions that this handler will manage on the objects


[ Top ]
string   $summaryName [line 67]

Name of the field which will be use as a summary for the object

For example : "summary"


[ Top ]
string   $table [line 33]

Name of the table use to store this IcmsPersistableObject

Note that the name of the table needs to be free of the database prefix. For example "smartsection_categories"


[ Top ]
mixed   $_allowedMimeTypes = 0 [line 97]

[ Top ]
mixed   $_disabledEvents = array() [line 124]

[ Top ]
mixed   $_eventHooks = array() [line 123]

[ Top ]
mixed   $_itemname [line 24]

[ Top ]
mixed   $_maxFileSize = 1000000 [line 99]

[ Top ]
mixed   $_maxHeight = 500 [line 103]

[ Top ]
mixed   $_maxWidth = 500 [line 101]

[ Top ]
mixed   $_moduleName [line 91]

[ Top ]
string   $_modulePath [line 87]

Full path of the module using this IcmsPersistableObject

  1. ICMS_URL "/modules/smartsection/"

Information Tags:
Todo:  this could probably be automatically deducted from the class name as it is always prefixed with the module name

[ Top ]
mixed   $_moduleUrl [line 89]

[ Top ]
string   $_page [line 78]

Page name use to basically manage and display the IcmsPersistableObject

This page needs to be the same in user side and admin side

For example category.php - we will deduct smartsection/category.php as well as smartsection/admin/category.php

Information Tags:
Todo:  this could probably be automatically deducted from the class name - for example, the class SmartsectionCategory will have "category.php" as it's managing page

[ Top ]
mixed   $_uploadPath [line 95]

[ Top ]
mixed   $_uploadUrl [line 93]

[ Top ]
Methods
Constructor IcmsPersistableObjectHandler  [line 137]

  IcmsPersistableObjectHandler IcmsPersistableObjectHandler( &$db, $itemname, string $keyname, string $idenfierName, $summaryName, $modulename, object $db, string $tablename, string $page, string $moduleName  )

Constructor - called from child classes

Parameters:
object   $db:  XoopsDatabase object
string   $tablename:  Name of the table use to store this IcmsPersistableObject
string   $keyname:  Name of the class derived from IcmsPersistableObject and which this handler is handling
string   $idenfierName:  Name of the field which properly identify the IcmsPersistableObject
string   $page:  Page name use to basically manage and display the IcmsPersistableObject
string   $moduleName:  name of the module
   &$db: 
   $itemname: 
   $summaryName: 
   $modulename: 


[ Top ]
addEventHook  [line 155]

  void addEventHook( $event, $method  )

Parameters:
   $event: 
   $method: 


[ Top ]
addPermission  [line 168]

  void addPermission( string $perm_name, string $caption, [string $description = false]  )

Add a permission that this handler will manage for its objects

Example : $this->addPermission('view', _AM_SSHOP_CAT_PERM_READ, _AM_SSHOP_CAT_PERM_READ_DSC);

Parameters:
string   $perm_name:  name of the permission
string   $caption:  caption of the control that will be displayed in the form
string   $description:  description of the control that will be displayed in the form


[ Top ]
convertResultSet  [line 397]

  array convertResultSet( object $result, [bool $id_as_key = false], [bool $as_object = true]  )

Convert a database resultset to a returnable array

Parameters:
object   $result:  database resultset
bool   $id_as_key:  - should NOT be used with joint keys
bool   $as_object: 


[ Top ]
create  [line 202]

  object {@link &create( [bool $isNew = true]  )

create a new IcmsPersistableObject

Parameters:
bool   $isNew:  Flag the new objects as "new"?

API Tags:
Return:  IcmsPersistableObject}


Redefinition of:
XoopsObjectHandler::create()
creates a new object

[ Top ]
delete  [line 540]

  bool delete( &$obj, [bool $force = false], object $obj  )

delete an object from the database

Parameters:
object   $obj:  reference to the object to delete
bool   $force: 
   &$obj: 

API Tags:
Return:  FALSE if failed.


Redefinition of:
XoopsObjectHandler::delete()
delete object from database

[ Top ]
deleteAll  [line 813]

  bool deleteAll( [object $criteria = null]  )

delete all objects meeting the conditions

Parameters:
object   $criteria:  CriteriaElement with conditions to meet


[ Top ]
disableEvent  [line 576]

  void disableEvent( $event  )

Parameters:
   $event: 


[ Top ]
executeEvent  [line 856]

  mixed executeEvent( string $event, &$executeEventObj, object $obj  )

Execute the function associated with an event This method will check if the function is available

Parameters:
string   $event:  name of the event
object   $obj:  $object on which is performed the event
   &$executeEventObj: 

API Tags:
Return:  result of the execution of the function or FALSE if the function was not executed


[ Top ]
get  [line 234]

  mixed &get( mixed $id, [bool $as_object = true], [ $debug = false], [ $criteria = false]  )

retrieve a IcmsPersistableObject

Parameters:
mixed   $id:  ID of the object - or array of ids for joint keys. Joint keys MUST be given in the same order as in the constructor
bool   $as_object:  whether to return an object or an array
   $debug: 
   $criteria: 

API Tags:
Return:  reference to the IcmsPersistableObject, FALSE if failed


Redefinition of:
XoopsObjectHandler::get()
gets a value object

[ Top ]
getCount  [line 489]

  int getCount( [object $criteria = null]  )

count objects matching a condition

Parameters:
object   $criteria:  CriteriaElement to match

API Tags:
Return:  count of objects


[ Top ]
getD  [line 284]

  mixed &getD( mixed $id, [bool $as_object = true]  )

retrieve a IcmsPersistableObject

Parameters:
mixed   $id:  ID of the object - or array of ids for joint keys. Joint keys MUST be given in the same order as in the constructor
bool   $as_object:  whether to return an object or an array

API Tags:
Return:  reference to the IcmsPersistableObject, FALSE if failed


[ Top ]
getIdentifierName  [line 877]

  void getIdentifierName( [ $withprefix = true]  )

Parameters:
   $withprefix: 


[ Top ]
getIdsFromObjectsAsArray  [line 591]

  void getIdsFromObjectsAsArray( array $objectsAsArray  )

Build an array containing all the ids of an array of objects as array

Parameters:
array   $objectsAsArray:  array of IcmsPersistableObject


[ Top ]
getImagePath  [line 219]

  void getImagePath( )



[ Top ]
getImageUrl  [line 215]

  void getImageUrl( )



[ Top ]
getList  [line 442]

  array getList( [object $criteria = null], [int $limit = 0], [int $start = 0], [ $debug = false]  )

Retrieve a list of objects as arrays - DON'T USE WITH JOINT KEYS

Parameters:
object   $criteria:  CriteriaElement conditions to be met
int   $limit:  Max number of objects to fetch
int   $start:  Which record to start at
   $debug: 


[ Top ]
getListD  [line 429]

  void getListD( [ $criteria = null], [ $limit = 0], [ $start = 0]  )

Parameters:
   $criteria: 
   $limit: 
   $start: 


[ Top ]
getModuleConfig  [line 831]

  void getModuleConfig( )



[ Top ]
getModuleInfo  [line 827]

  void getModuleInfo( )



[ Top ]
getModuleItemString  [line 835]

  void getModuleItemString( )



[ Top ]
getObjects  [line 297]

  array getObjects( [object $criteria = null], [bool $id_as_key = false], [bool $as_object = true], [ $sql = false], [ $debug = false]  )

retrieve objects from the database

Parameters:
object   $criteria:  CriteriaElement conditions to be met
bool   $id_as_key:  use the ID as key for the array?
bool   $as_object:  return an array of objects?
   $sql: 
   $debug: 


[ Top ]
getObjectsAsArray  [line 376]

  void getObjectsAsArray( $arrayObjects  )

Parameters:
   $arrayObjects: 


[ Top ]
getObjectsD  [line 371]

  array getObjectsD( [object $criteria = null], [bool $id_as_key = false], [bool $as_object = true], [ $sql = false]  )

retrieve objects with debug mode - so will show the query

Parameters:
object   $criteria:  CriteriaElement conditions to be met
bool   $id_as_key:  use the ID as key for the array?
bool   $as_object:  return an array of objects?
   $sql: 


[ Top ]
getPermissions  [line 599]

  void getPermissions( )



[ Top ]
insert  [line 611]

  bool insert( &$obj, [bool $force = false], [bool $checkObject = true], [ $debug = false], object $obj  )

insert a new object in the database

Parameters:
object   $obj:  reference to the object
bool   $force:  whether to force the query execution despite security settings
bool   $checkObject:  check if the object is dirty and clean the attributes
   &$obj: 
   $debug: 

API Tags:
Return:  FALSE if failed, TRUE if already present and unchanged or successful


Redefinition of:
XoopsObjectHandler::insert()
insert/update object

[ Top ]
insertD  [line 767]

  void insertD( &$obj, [ $force = false], [ $checkObject = true], [ $debug = false]  )

Parameters:
   &$obj: 
   $force: 
   $checkObject: 
   $debug: 


[ Top ]
query  [line 327]

  void query( $sql, $criteria, [ $force = false], [ $debug = false]  )

Parameters:
   $sql: 
   $criteria: 
   $force: 
   $debug: 


[ Top ]
setGrantedObjectsCriteria  [line 176]

  void setGrantedObjectsCriteria( &$criteria, $perm_name  )

Parameters:
   &$criteria: 
   $perm_name: 


[ Top ]
setUploaderConfig  [line 187]

  void setUploaderConfig( [ $_uploadPath = false], [ $_allowedMimeTypes = false], [ $_maxFileSize = false], [ $_maxWidth = false], [ $_maxHeight = false]  )

Parameters:
   $_uploadPath: 
   $_allowedMimeTypes: 
   $_maxFileSize: 
   $_maxWidth: 
   $_maxHeight: 


[ Top ]
updateAll  [line 781]

  bool updateAll( string $fieldname, string $fieldvalue, [object $criteria = null], [ $force = false]  )

Change a value for objects with a certain criteria

Parameters:
string   $fieldname:  Name of the field
string   $fieldvalue:  Value to write
object   $criteria:  CriteriaElement
   $force: 


[ Top ]
updateCounter  [line 840]

  void updateCounter( $object  )

Parameters:
   $object: 


[ Top ]

Documentation generated on Sat, 15 Nov 2008 14:17:44 -0600 by phpDocumentor 1.4.1