-
Notifications
You must be signed in to change notification settings - Fork 35
icms_data_notification_Handler
Notice: Wiki was automatic generated from project sources as project API documentation. Do not edit manually!
Notification handler class.
This class is responsible for providing data access mechanisms to the data source of notification class objects.
- Class name: icms_data_notification_Handler
- Namespace:
- Parent class: icms_ipf_Handler
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_data_notification_Handler::getNotification(int module_id, string category, int item_id, string event, int user_id)
Change a value in multiple notifications
- Visibility: public
- module_id int - <p>module ID to get notification for</p>
- category string - <p>category to get notification for</p>
- item_id int - <p>item ID to get notification for</p>
- event string - <p>module ID to get notification for</p>
- user_id int - <p>user ID to get notification for</p>
mixed icms_data_notification_Handler::isSubscribed(string category, int item_id, string event, int module_id, int user_id)
Determine if a user is subscribed to a particular event in a particular module.
- Visibility: public
- category string - <p>Category of notification event</p>
- item_id int - <p>Item ID of notification event</p>
- event string - <p>Event</p>
- module_id int - <p>ID of module (default current module)</p>
- user_id int - <p>ID of user (default current user) return int 0 if not subscribe; non-zero if subscribed (boolean... sort of)</p>
mixed icms_data_notification_Handler::subscribe(string category, int item_id, mixed events, int mode, int module_id, int user_id)
Subscribe for notification for an event(s)
- Visibility: public
- category string - <p>category of notification</p>
- item_id int - <p>ID of the item</p>
- events mixed - <p>event string or array of events</p>
- mode int - <p>force a particular notification mode (e.g. once_only) (default to current user preference)</p>
- module_id int - <p>ID of the module (default to current module)</p>
- user_id int - <p>ID of the user (default to current user)</p>
\icms_data_notification_Object[] icms_data_notification_Handler::getByUser(int user_id)
Get a list of notifications by user ID
- Visibility: public
- user_id int - <p>ID of the user</p>
\icms_data_notification_Object[] icms_data_notification_Handler::getSubscribedEvents(string category, int item_id, int module_id, int user_id)
Get a list of notification events for the current item/mod/user
- Visibility: public
- category string - <p>category for the subscribed events</p>
- item_id int - <p>ID of the subscribed items</p>
- module_id int - <p>ID of the module of the subscribed items</p>
- user_id int - <p>ID of the user of the subscribed items</p>
\icms_data_notification_Object[] icms_data_notification_Handler::getByItemId(int module_id, int item_id, string order, string status)
Retrieve items by their ID
- Visibility: public
- module_id int - <p>Module ID</p>
- item_id int - <p>Item ID</p>
- order string - <p>Sort order</p>
- status string - <p>status</p>
mixed icms_data_notification_Handler::triggerEvents(mixed category, mixed item_id, mixed events, mixed extra_tags, mixed user_list, mixed module_id, mixed omit_user_id)
- Visibility: public
- category mixed
- item_id mixed
- events mixed
- extra_tags mixed
- user_list mixed
- module_id mixed
- omit_user_id mixed
mixed icms_data_notification_Handler::triggerEvent(string category, int item_id, string event, array extra_tags, array user_list, int module_id, int omit_user_id)
Send notifications to users
- Visibility: public
- category string - <p>notification category</p>
- item_id int - <p>ID of the item</p>
- event string - <p>notification event</p>
- extra_tags array - <p>array of substitutions for template to be merged with the one from function..</p>
- user_list array - <p>only notify the selected users</p>
- module_id int - <p>ID of the module</p>
- omit_user_id int - <p>ID of the user to omit from notifications. (default to current user). set to 0 for all users to receive notification.</p>
bool icms_data_notification_Handler::unsubscribeByUser(int user_id)
Delete all notifications for one user
- Visibility: public
- user_id int - <p>ID of the user</p>
bool icms_data_notification_Handler::unsubscribe(string category, int item_id, mixed events, int module_id, int user_id)
Unsubscribe notifications for an event(s).
- Visibility: public
- category string - <p>category of the events</p>
- item_id int - <p>ID of the item</p>
- events mixed - <p>event string or array of events</p>
- module_id int - <p>ID of the module (default current module)</p>
- user_id int - <p>UID of the user (default current user)</p>
bool icms_data_notification_Handler::unsubscribeByModule(int module_id)
Delete all notifications for a particular module
- Visibility: public
- module_id int - <p>ID of the module</p>
bool icms_data_notification_Handler::unsubscribeByItem(int module_id, string category, int item_id)
Delete all subscriptions for a particular item.
- Visibility: public
- module_id int - <p>ID of the module to which item belongs</p>
- category string - <p>Notification category of the item</p>
- item_id int - <p>ID of the item</p>
mixed icms_data_notification_Handler::doLoginMaintenance(int user_id)
Perform notification maintenance activites at login time.
In particular, any notifications for the newly logged-in user with mode XOOPS_NOTIFICATION_MODE_WAITFORLOGIN are switched to mode XOOPS_NOTIFICATION_MODE_SENDONCETHENWAIT.
- Visibility: public
- user_id int - <p>ID of the user being logged in</p>
bool icms_data_notification_Handler::updateByField(mixed notification, string field_name, mixed field_value)
Update
- Visibility: public
- notification mixed
- field_name string - <p>Name of the field</p>
- field_value mixed - <p>Value to write</p>
bool icms_data_notification_Handler::isEnabled(string style, int module_id)
Determine if notification is enabled for the selected module.
- Visibility: public
- This method is static.
- style string - <p>Subscription style: 'block' or 'inline'</p>
- module_id int - <p>ID of the module (default current module)</p>
mixed icms_data_notification_Handler::categoryInfo(mixed category_name, int module_id)
Get an associative array of info for a particular notification category in the selected module. If no category is selected, return an array of info for all categories.
- Visibility: public
- This method is static.
- category_name mixed
- module_id int - <p>ID of the module (default current module)</p>
mixed icms_data_notification_Handler::commentCategoryInfo(int module_id)
Get associative array of info for the category to which comment events belong.
- Visibility: public
- This method is static.
- module_id int - <p>ID of the module (default current module)</p>
mixed icms_data_notification_Handler::categoryEvents(string category_name, bool enabled_only, int module_id)
Get an array of info for all events (each event has associative array) in the selected category of the selected module.
- Visibility: public
- This method is static.
- category_name string - <p>Category name</p>
- enabled_only bool - <p>If true, return only enabled events</p>
- module_id int - <p>ID of the module (default current module)</p>
bool icms_data_notification_Handler::eventEnabled(array category, array event, object module)
Determine whether a particular notification event is enabled.
Depends on module config options.
- Visibility: public
- This method is static.
- category array - <p>Category info array</p>
- event array - <p>Event info array</p>
- module object - <p>Module</p>
mixed icms_data_notification_Handler::eventInfo(string category_name, string event_name, int module_id)
Get associative array of info for the selected event in the selected category (for the selected module).
- Visibility: public
- This method is static.
- category_name string - <p>Notification category</p>
- event_name string - <p>Notification event</p>
- module_id int - <p>ID of the module (default current module)</p>
mixed icms_data_notification_Handler::subscribableCategoryInfo(int module_id)
Get an array of associative info arrays for subscribable categories for the selected module.
- Visibility: public
- This method is static.
- module_id int - <p>ID of the module</p>
mixed icms_data_notification_Handler::generateConfig(array category, array event, string type)
Generate module config info for a particular category, event pair.
The selectable config options are given names depending on the category and event names, and the text depends on the category and event titles. These are pieced together in this function in case we wish to alter the syntax.
- Visibility: public
- This method is static.
- category array - <p>Array of category info</p>
- event array - <p>Array of event info</p>
- type string - <p>The particular name to generate return string</p>
mixed icms_ipf_Handler::addEventHook(\str event, \str method)
- Visibility: public
- This method is defined by icms_ipf_Handler
- 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
- This method is defined by icms_ipf_Handler
- 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
- This method is defined by icms_ipf_Handler
- 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
- This method is defined by icms_ipf_Handler
- 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
- This method is defined by icms_ipf_Handler
- 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
- This method is defined by icms_ipf_Handler
- 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
- This method is defined by icms_ipf_Handler
- 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
- This method is defined by icms_ipf_Handler
- 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
- This method is defined by icms_ipf_Handler
- result mixed
- key mixed
mixed icms_ipf_Handler::convertResultSet_RAW(mixed result)
- Visibility: protected
- This method is defined by icms_ipf_Handler
- result mixed
mixed icms_ipf_Handler::convertResultSet_ObjectWithKey(mixed result, mixed key, mixed as_object)
- Visibility: protected
- This method is defined by icms_ipf_Handler
- result mixed
- key mixed
- as_object mixed
array icms_ipf_Handler::getSkipKeys()
Get array with keys for skipping
- Visibility: public
- This method is defined by icms_ipf_Handler
mixed icms_ipf_Handler::getImageUrl()
- Visibility: public
- This method is defined by icms_ipf_Handler
mixed icms_ipf_Handler::getImagePath()
- Visibility: public
- This method is defined by icms_ipf_Handler
mixed icms_ipf_Handler::convertResultSet_Object(mixed result, mixed as_object)
- Visibility: protected
- This method is defined by icms_ipf_Handler
- result mixed
- as_object mixed
\icms_ipf_Object|bool icms_ipf_Handler::getD(string|float|int id, bool as_object)
retrieve object
- Visibility: public
- This method is defined by icms_ipf_Handler
- 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
- This method is defined by icms_ipf_Handler
- 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
- This method is defined by icms_ipf_Handler
- 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
- This method is defined by icms_ipf_Handler
- 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
- This method is defined by icms_ipf_Handler
- withprefix bool
mixed icms_ipf_Handler::insertD(\obj obj, bool force, bool checkObject, bool debug)
- Visibility: public
- This method is defined by icms_ipf_Handler
- 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
- This method is defined by icms_ipf_Handler
- 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
- This method is defined by icms_ipf_Handler
- event string - <p>name of the event</p>
- executeEventObj mixed
string icms_ipf_Handler::generateInsertSQL(mixed data)
Generate insert SQL by data
- Visibility: protected
- This method is defined by icms_ipf_Handler
- data mixed
string|null icms_ipf_Handler::generateUpdateSQL(mixed data)
Generates update SQL
- Visibility: protected
- This method is defined by icms_ipf_Handler
- 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
- This method is defined by icms_ipf_Handler
- 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
- This method is defined by icms_ipf_Handler
- 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
- This method is defined by icms_ipf_Handler
- 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
- This method is defined by icms_ipf_Handler
- criteria icms_db_criteria_Element - <p>Criteria to match</p>
mixed icms_ipf_Handler::disableEvent(\arr|\str event)
- Visibility: public
- This method is defined by icms_ipf_Handler
- 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
- This method is defined by icms_ipf_Handler
- 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
- This method is defined by icms_ipf_Handler
- 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
- This method is defined by icms_ipf_Handler
- 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
- This method is defined by icms_ipf_Handler
- obj object - <p>optional</p>
mixed icms_ipf_Handler::getPermissions()
Accessor for the permissions array property
- Visibility: public
- This method is defined by icms_ipf_Handler
mixed icms_ipf_Handler::getModuleInfo()
- Visibility: public
- This method is defined by icms_ipf_Handler
mixed icms_ipf_Handler::getModuleConfig()
- Visibility: public
- This method is defined by icms_ipf_Handler
mixed icms_ipf_Handler::getModuleItemString()
- Visibility: public
- This method is defined by icms_ipf_Handler
mixed icms_ipf_Handler::updateCounter(object)
- Visibility: public
- This method is defined by icms_ipf_Handler
- object mixed
mixed icms_ipf_Handler::enableUpload(\unknown_type allowedMimeTypes, \unknown_type maxFileSize, \unknown_type maxWidth, \unknown_type maxHeight)
- Visibility: public
- This method is defined by icms_ipf_Handler
- allowedMimeTypes unknown_type
- maxFileSize unknown_type
- maxWidth unknown_type
- maxHeight unknown_type