-
Notifications
You must be signed in to change notification settings - Fork 35
icms_ipf_Handler
Notice: Wiki was automatic generated from project sources as project API documentation. Do not edit manually!
Persistable Object Handlder
This class is an abstract class of handler classes that are responsible for providing data access mechanisms to the data source of its corresponsing data objects
- Class name: icms_ipf_Handler
- Namespace:
- Parent class: icms_core_ObjectHandler
protected array $_loadedItems = array()
Loaded items cache
- Visibility: protected
- This property is static.
protected mixed $cached_fields = array()
- Visibility: protected
- This property is static.
public string $_itemname
The name of the IPF object
- Visibility: public
public string $table
Name of the table use to store objects linked with this handler
Note that the name of the table needs to be free of the database prefix. For example "smartsection_categories"
- Visibility: public
public string $keyName
Name of the table key that uniquely identify each object
For example : "categoryid"
- Visibility: public
public string $className
Name of the class derived from object and which this handler is handling
Note that this string needs to be lowercase
For example : "smartsectioncategory"
- Visibility: public
public string $identifierName
Name of the field which properly identify the object
For example : "name" (this will be the category's name)
- Visibility: public
public string $summaryName
Name of the field which will be use as a summary for the object
For example : "summary"
- Visibility: public
public string $_page
Page name use to basically manage and display the object
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
- Visibility: public
public string $_modulePath
Full path of the module using this object
ICMS_URL . "/modules/smartsection/"
- Visibility: public
public string $_moduleUrl
Module URL
- Visibility: public
public string $_moduleName
The name of the module for the object
- Visibility: public
public bool $uploadEnabled = \false
Is upload enabled?
- Visibility: public
public string $_uploadUrl
Upload URL
- Visibility: public
public string $_uploadPath
Upload Path
- Visibility: public
public array $_allowedMimeTypes = []
Allowed mimetypes
- Visibility: public
public int $_maxFileSize = 1000000
Max allowed file size for upload
- Visibility: public
public int $_maxWidth = 500
Max allowed width for file upload
- Visibility: public
public int $_maxHeight = 500
Max file height for upload
- Visibility: public
public array $highlightFields = array()
What fields to highlight?
- Visibility: public
public array $visibleColumns = array()
What columns should be viisble.
Empty array means all.
- Visibility: public
public array $eventArray = array()
Array containing the events name and functions
- Visibility: public
public array $permissionsArray = array()
Array containing the permissions that this handler will manage on the objects
- Visibility: public
public string $generalSQL
Some SQL that will be used as base for all operations for this handler
- Visibility: public
public array $_eventHooks = array()
Events hooks
- Visibility: public
public array $_disabledEvents = array()
Disabled events
- Visibility: public
public bool $debugMode = \false
Is debug mode?
- Visibility: public
public \icms_db_legacy_Database $db
holds referenced
- Visibility: public
mixed icms_core_ObjectHandler::__construct(\icms_db_legacy_Database db)
called from child classes only
- Visibility: public
- This method is defined by icms_core_ObjectHandler
- db icms_db_legacy_Database - <p>reference to db</p>
mixed icms_ipf_Handler::addEventHook(\str event, \str method)
- Visibility: public
- event str
- method str
mixed icms_ipf_Handler::addPermission(string perm_name, string caption, string description)
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);
- Visibility: public
- perm_name string - <p>name of the permission</p>
- caption string - <p>caption of the control that will be displayed in the form</p>
- description string - <p>description of the control that will be displayed in the form</p>
mixed icms_ipf_Handler::setGrantedObjectsCriteria(\obj criteria, \str perm_name)
- Visibility: public
- criteria obj
- perm_name str
array icms_ipf_Handler::getCalculatedInfo(array field_func, \icms_db_criteria_Element criteria, bool debug)
Runs precalculated info
- Visibility: public
- field_func array
- criteria icms_db_criteria_Element
- debug bool
array icms_ipf_Handler::getObjectsD(\icms_db_criteria_Element criteria, bool id_as_key, bool as_object, mixed sql)
retrieve objects with debug mode - so will show the query
- Visibility: public
- criteria icms_db_criteria_Element - <p>Criteria conditions to be met</p>
- id_as_key bool - <p>use the ID as key for the array?</p>
- as_object bool - <p>return an array of objects?</p>
- sql mixed
array icms_ipf_Handler::getObjects(\icms_db_criteria_Element criteria, bool id_as_key, bool as_object, mixed sql, mixed debug)
retrieve objects from the database
- Visibility: public
- criteria icms_db_criteria_Element - <p>Criteria conditions to be met</p>
- id_as_key bool - <p>use the ID as key for the array?</p>
- as_object bool - <p>return an array of objects?</p>
- sql mixed
- debug mixed
string icms_ipf_Handler::getFields(bool getcurrent, bool forSQL)
Gets all fields for SQL
- Visibility: protected
- getcurrent bool - <p>Get current fields</p>
- forSQL bool - <p>Returns fields result as for SQL</p>
array icms_ipf_Handler::convertResultSet(object result, bool id_as_key, bool as_object)
Convert a database resultset to a returnable array
- Visibility: public
- result object - <p>database resultset</p>
- id_as_key bool - <ul> <li>should NOT be used with joint keys</li> </ul>
- as_object bool
mixed icms_ipf_Handler::convertResultSet_RAWWithKey(mixed result, mixed key)
- Visibility: protected
- result mixed
- key mixed
mixed icms_ipf_Handler::convertResultSet_RAW(mixed result)
- Visibility: protected
- result mixed
mixed icms_ipf_Handler::convertResultSet_ObjectWithKey(mixed result, mixed key, mixed as_object)
- Visibility: protected
- result mixed
- key mixed
- as_object mixed
array icms_ipf_Handler::getSkipKeys()
Get array with keys for skipping
- Visibility: public
mixed icms_ipf_Handler::getImageUrl()
- Visibility: public
mixed icms_ipf_Handler::getImagePath()
- Visibility: public
mixed icms_ipf_Handler::convertResultSet_Object(mixed result, mixed as_object)
- Visibility: protected
- result mixed
- as_object mixed
\icms_ipf_Object|bool icms_ipf_Handler::getD(string|float|int id, bool as_object)
retrieve object
- Visibility: public
- id string|float|int - <p>ID of the object - or array of ids for joint keys. Joint keys MUST be given in the same order as in the constructor</p>
- as_object bool - <p>whether to return an object or an array</p>
mixed icms_core_ObjectHandler::get(int int_id)
gets a value object
- Visibility: public
- This method is abstract.
- This method is defined by icms_core_ObjectHandler
- int_id int
mixed icms_core_ObjectHandler::create()
creates a new object
- Visibility: public
- This method is abstract.
- This method is defined by icms_core_ObjectHandler
array icms_ipf_Handler::getListD(object criteria, int limit, int start)
- Visibility: public
- criteria object
- limit int
- start int
array icms_ipf_Handler::getList(\icms_db_criteria_Element criteria, int limit, int start, mixed debug)
Retrieve a list of objects as arrays - DON'T USE WITH JOINT KEYS
- Visibility: public
- criteria icms_db_criteria_Element - <p>Criteria conditions to be met</p>
- limit int - <p>Max number of objects to fetch</p>
- start int - <p>Which record to start at</p>
- debug mixed
array icms_ipf_Handler::getCustomList(string keyName, string keyValue, \icms_db_criteria_Element criteria, int limit, int start, bool debug)
Retrieve a list of objects as arrays - DON'T USE WITH JOINT KEYS
- Visibility: public
- keyName string - <p>Key name</p>
- keyValue string - <p>Key value</p>
- criteria icms_db_criteria_Element - <p>Criteria conditions to be met</p>
- limit int - <p>Max number of objects to fetch</p>
- start int - <p>Which record to start at</p>
- debug bool - <p>Debug mode?</p>
mixed icms_ipf_Handler::getIdentifierName(bool withprefix)
- Visibility: public
- withprefix bool
mixed icms_ipf_Handler::insertD(\obj obj, bool force, bool checkObject, bool debug)
- Visibility: public
- obj obj
- force bool
- checkObject bool
- debug bool
bool icms_ipf_Handler::save(mixed obj_instances, bool force)
Saves one or many items
- Visibility: public
- obj_instances mixed
- force bool - <p>Force saving?</p>
mixed icms_ipf_Handler::executeEvent(string event, mixed executeEventObj)
Execute the function associated with an event This method will check if the function is available
- Visibility: public
- event string - <p>name of the event</p>
- executeEventObj mixed
string icms_ipf_Handler::generateInsertSQL(mixed data)
Generate insert SQL by data
- Visibility: protected
- data mixed
string|null icms_ipf_Handler::generateUpdateSQL(mixed data)
Generates update SQL
- Visibility: protected
- data mixed
mixed icms_core_ObjectHandler::insert(object object)
insert/update object
- Visibility: public
- This method is abstract.
- This method is defined by icms_core_ObjectHandler
- object object
mixed icms_ipf_Handler::getObjectsAsArray(\arr arrayObjects)
- Visibility: public
- arrayObjects arr
array icms_ipf_Handler::doFastChange(mixed id, string field, \numeric value, string math_func, bool force, bool debug)
Execute fast change with data
- Visibility: public
- id mixed
- field string
- value numeric
- math_func string
- force bool
- debug bool
array icms_ipf_Handler::query(string sql, \icms_db_criteria_Element criteria, bool force, bool debug)
query the database with the constructed $criteria object
- Visibility: public
- sql string - <p>The SQL Query</p>
- criteria icms_db_criteria_Element - <p>Criteria conditions to be met</p>
- force bool - <p>Force the query?</p>
- debug bool - <p>Turn Debug on?</p>
int icms_ipf_Handler::getCount(\icms_db_criteria_Element criteria)
count objects matching a condition
- Visibility: public
- criteria icms_db_criteria_Element - <p>Criteria to match</p>
mixed icms_ipf_Handler::disableEvent(\arr|\str event)
- Visibility: public
- event arr|str
mixed icms_ipf_Handler::getIdsFromObjectsAsArray(array objectsAsArray)
Build an array containing all the ids of an array of objects as array
- Visibility: public
- objectsAsArray array - <p>array of icms_ipf_Object</p>
bool icms_ipf_Handler::updateAll(string fieldname, string fieldvalue, \icms_db_criteria_Element criteria, mixed force)
Change a value for objects with a certain criteria
- Visibility: public
- fieldname string - <p>Name of the field</p>
- fieldvalue string - <p>Value to write</p>
- criteria icms_db_criteria_Element - <p>Criteria</p>
- force mixed
bool icms_ipf_Handler::deleteAll(\icms_db_criteria_Element criteria, bool quick)
delete all objects meeting the conditions
- Visibility: public
- criteria icms_db_criteria_Element - <p>Criteria with conditions to meet</p>
- quick bool - <p>Do not load object on deletion?</p>
mixed icms_core_ObjectHandler::delete(object object)
delete object from database
- Visibility: public
- This method is abstract.
- This method is defined by icms_core_ObjectHandler
- object object
bool icms_ipf_Handler::deleteGrantedPermissions(object obj)
delete granted permssions for an object
- Visibility: private
- obj object - <p>optional</p>
mixed icms_ipf_Handler::getPermissions()
Accessor for the permissions array property
- Visibility: public
mixed icms_ipf_Handler::getModuleInfo()
- Visibility: public
mixed icms_ipf_Handler::getModuleConfig()
- Visibility: public
mixed icms_ipf_Handler::getModuleItemString()
- Visibility: public
mixed icms_ipf_Handler::updateCounter(object)
- Visibility: public
- object mixed
mixed icms_ipf_Handler::enableUpload(\unknown_type allowedMimeTypes, \unknown_type maxFileSize, \unknown_type maxWidth, \unknown_type maxHeight)
- Visibility: public
- allowedMimeTypes unknown_type
- maxFileSize unknown_type
- maxWidth unknown_type
- maxHeight unknown_type