-
Notifications
You must be signed in to change notification settings - Fork 35
icms_core_Object
Notice: Wiki was automatic generated from project sources as project API documentation. Do not edit manually!
Base class for all objects in the kernel (and beyond)
- Class name: icms_core_Object
- Namespace:
- Parent class: icms_properties_Handler
const DTYPE_STRING = 2
const DTYPE_INTEGER = 3
const DTYPE_FLOAT = 201
const DTYPE_BOOLEAN = 105
const DTYPE_FILE = 104
const DTYPE_DATETIME = 11
const DTYPE_ARRAY = 6
const DTYPE_LIST = 101
const DTYPE_OBJECT = 12
const DTYPE_DEP_OTHER = 7
const DTYPE_DEP_FILE = 204
const DTYPE_DEP_TXTBOX = 1
const DTYPE_DEP_URL = 4
const DTYPE_DEP_EMAIL = 5
const DTYPE_DEP_SOURCE = 8
const DTYPE_DEP_STIME = 9
const DTYPE_DEP_MTIME = 10
const DTYPE_DEP_CURRENCY = 200
const DTYPE_DEP_TIME_ONLY = 202
const DTYPE_DEP_URLLINK = 203
const DTYPE_DEP_IMAGE = 205
const DTYPE_DEP_FORM_SECTION = 210
const DTYPE_DEP_FORM_SECTION_CLOSE = 211
const VARCFG_ALLOWED_MIMETYPES = allowedMimeTypes
const VARCFG_MAX_FILESIZE = maxFileSize
const VARCFG_MAX_WIDTH = maxWidth
const VARCFG_MAX_HEIGHT = maxHeight
const VARCFG_PREFIX = prefix
const VARCFG_PATH = path
const VARCFG_FILENAME_FUNCTION = filenameGenerator
const VARCFG_POSSIBLE_OPTIONS = possibleOptions
const VARCFG_LOCKED = locked
const VARCFG_HIDE = hide
const VARCFG_RENDER_TYPE = renderType
const VARCFG_SEPARATOR = separator
const VARCFG_MAX_LENGTH = maxLength
const VARCFG_VALIDATE_RULE = validateRule
const VARCFG_SOURCE_FORMATING = sourceFormating
const VARCFG_FORMAT = format
const VARCFG_AF_DISABLED = autoFormatingDisabled
const VARCFG_NOT_GPC = not_gpc
const VARCFG_CHANGED = changed
const VARCFG_VALUE = value
const VARCFG_TYPE = data_type
const VARCFG_REQUIRED = required
const VARCFG_DATA_HANDLER = data_handler
const VARCFG_DEP_DATA_TYPE = depDataType
const VARCFG_FORM_CAPTION = form_caption
const VARCFG_FORM_DESC = form_dsc
const VARCFG_DEFAULT_VALUE = default_value
const VARCFG_NOTLOADED = not_loaded
const VALIDATE_RULE_EMAIL = /^[a-z0-9]+([_\.-][a-z0-9]+)*@([a-z0-9]+([\.-][a-z0-9]+)*)+\.[a-z]{2,}$/i
const VALIDATE_RULE_LINKS = #^http(s)?://[a-z0-9-_.]+\.[a-z]{2,4}#i
private bool $_isNew = \false
is it a newly created object?
- Visibility: private
private array $_errors = array()
errors
- Visibility: private
private mixed $_filters = array()
additional filters registered dynamically by a child class object
- Visibility: private
protected array $_vars = array()
Vars configuration
- Visibility: protected
protected int $_changed
Changed vars count
- Visibility: protected
mixed icms_core_Object::__construct()
constructor
normally, this is called from child classes only
- Visibility: public
mixed icms_core_Object::unsetNew()
- Visibility: public
mixed icms_core_Object::isNew()
- Visibility: public
mixed icms_properties_Handler::initVar(string key, int dataType, mixed defaultValue, bool required, mixed otherCfg)
Initialize var (property) for the object
- Visibility: protected
- This method is defined by icms_properties_Handler
- key string - <p>Var name</p>
- dataType int - <p>Var data type (use constants DTYPE_* for specifing it!)</p>
- defaultValue mixed - <p>Default value</p>
- required bool - <p>Is Required?</p>
- otherCfg mixed
mixed icms_core_Object::setFormVars(array var_arr, string pref, mixed not_gpc)
Assign values to multiple variables in a batch
Meant for a CGI context:
- prefixed CGI args are considered safe
- avoids polluting of namespace with CGI args
- Visibility: public
- var_arr array - <p>associative array of values to assign</p>
- pref string - <p>prefix (only keys starting with the prefix will be set)</p>
- not_gpc mixed
mixed icms_core_Object::registerFilter(string filtername)
dynamically register additional filter for the object
- Visibility: public
- filtername string - <p>name of the filter</p>
object icms_core_Object::xoopsClone()
Clone current instance
- Visibility: public
mixed icms_core_Object::setDirty()
Sets object modified
- Visibility: public
mixed icms_core_Object::unsetDirty()
Sets object unmodified
- Visibility: public
mixed icms_core_Object::isDirty()
Is object modified?
- Visibility: public
mixed icms_core_Object::__clone()
Create cloned copy of current object
- Visibility: public
mixed icms_core_Object::setNew()
- Visibility: public
array icms_core_Object::getErrors()
return the errors for this object as an array
- Visibility: public
mixed icms_core_Object::setErrors(mixed err_str, mixed prefix)
add an error
- Visibility: public
- err_str mixed
- prefix mixed
string icms_core_Object::getHtmlErrors()
return the errors for this object as html
- Visibility: public
mixed icms_core_Object::hasError()
- Visibility: public
mixed icms_core_Object::_loadFilters()
load all additional filters that have been registered to the object
- Visibility: private
mixed icms_properties_Handler::assignVars(array values)
Assigns values from array to vars
- Visibility: public
- This method is defined by icms_properties_Handler
- values array - <p>Assoc arary with keys and values to assign</p>
mixed icms_properties_Handler::cleanVar(string key, string type, string value)
Cleans value for var
- Visibility: protected
- This method is defined by icms_properties_Handler
- key string - <p>Var name</p>
- type string - <p>Var type</p>
- value string - <p>new value</p>
string icms_properties_Handler::getFileMimeType(string filename)
Gets mymetype from filename
- Visibility: private
- This method is defined by icms_properties_Handler
- filename string - <p>Filename</p>
mixed icms_properties_Handler::initCommonVar(string varname, bool displayOnForm, string default)
Inits common var
- Visibility: public
- This method is defined by icms_properties_Handler
- varname string - <p>Var name</p>
- displayOnForm bool - <p>Display on form</p>
- default string - <p>Default value</p>
bool icms_properties_Handler::__isset(string name)
Checks if var exists
- Visibility: public
- This method is defined by icms_properties_Handler
- name string - <p>Var name</p>
mixed icms_properties_Handler::assignVar(string key, mixed value)
assign a value to a variable
- Visibility: public
- This method is defined by icms_properties_Handler
- key string - <p>name of the variable to assign</p>
- value mixed - <p>value to assign</p>
bool icms_properties_Handler::isChanged()
If is object variables has been changed?
- Visibility: public
- This method is defined by icms_properties_Handler
array icms_properties_Handler::getChangedVars()
Gets changes vars
- Visibility: public
- This method is defined by icms_properties_Handler
array icms_properties_Handler::getProblematicVars()
Gets an array with required but not specified vars
- Visibility: public
- This method is defined by icms_properties_Handler
bool icms_properties_Handler::isVarSet(int type, string key)
Checks if var is set
- Visibility: private
- This method is defined by icms_properties_Handler
- type int
- key string
array icms_properties_Handler::getDefaultVars()
Gets default values for all vars
- Visibility: public
- This method is defined by icms_properties_Handler
mixed icms_properties_Handler::getVarInfo(string key, string info, mixed default)
Returns array of vars or only one var (if name specified) with selected info field
- Visibility: public
- This method is defined by icms_properties_Handler
- key string - <p>Var name</p>
- info string - <p>Var info to get</p>
- default mixed - <p>Default response</p>
array icms_properties_Handler::getVars()
returns all variables for the object
- Visibility: public
- This method is defined by icms_properties_Handler
mixed icms_properties_Handler::setVars(array var_arr, bool not_gpc)
Assign values to multiple variables in a batch
- Visibility: public
- This method is defined by icms_properties_Handler
- var_arr array - <p>associative array of values to assign</p>
- not_gpc bool
mixed icms_properties_Handler::setVar(string name, mixed value, array options)
Sets var value
- Visibility: public
- This method is defined by icms_properties_Handler
- name string - <p>Var name</p>
- value mixed - <p>New value</p>
- options array - <p>Options to apply when settings values</p>
mixed icms_properties_Handler::setVarInfo(string key, string info, mixed value)
Sets var info
- Visibility: public
- This method is defined by icms_properties_Handler
- key string - <p>Var name</p>
- info string - <p>Var option</p>
- value mixed - <p>Options value</p>
array icms_properties_Handler::getVarNames()
Return array of properties names
- Visibility: public
- This method is defined by icms_properties_Handler
mixed icms_properties_Handler::setType(string key, int type)
Changes type for var
- Visibility: public
- This method is defined by icms_properties_Handler
- key string - <p>Var name</p>
- type int - <p>Type</p>
mixed icms_properties_Handler::doSetFieldAsRequired(string key, bool is_required)
Sets field as required
- Visibility: public
- This method is defined by icms_properties_Handler
- key string - <p>Var name</p>
- is_required bool - <p>Is required?</p>
array icms_properties_Handler::cleanVars()
Returns cleaned vars array
- Visibility: public
- This method is defined by icms_properties_Handler
array icms_properties_Handler::toArray()
Returns properties as key-value array
- Visibility: public
- This method is defined by icms_properties_Handler
string icms_properties_Handler::serialize()
Serialize instance to string
- Visibility: public
- This method is defined by icms_properties_Handler
array icms_properties_Handler::getValues(mixed keys, string format, int maxDepth)
Returns the values of the specified variables
- Visibility: public
- This method is defined by icms_properties_Handler
- keys mixed - <p>An array containing the names of the keys to retrieve, or null to get all of them</p>
- format string - <p>Format to use (see getVar)</p>
- maxDepth int - <p>Maximum level of recursion to use if some vars are objects themselves</p>
mixed icms_properties_Handler::getVar(mixed name, string format)
Returns a specific variable for the object in a proper format
- Visibility: public
- This method is defined by icms_properties_Handler
- name mixed
- format string - <p>format to use for the output</p>
mixed icms_properties_Handler::getVarForDisplay(string name)
Gets var value for displaying
- Visibility: public
- This method is defined by icms_properties_Handler
- name string
mixed icms_properties_Handler::getVarForEdit(string name)
Gets var value for editing
- Visibility: public
- This method is defined by icms_properties_Handler
- name string
mixed icms_properties_Handler::getVarForForm(string name)
Gets var value for form
- Visibility: public
- This method is defined by icms_properties_Handler
- name string
mixed icms_properties_Handler::__get(string name)
Magic function to get property value by accessing it by name
- Visibility: public
- This method is defined by icms_properties_Handler
- name string
mixed icms_properties_Handler::__set(string name, mixed value)
Magic function to work with properties as class variables (set them)
- Visibility: public
- This method is defined by icms_properties_Handler
- name string - <p>Var name</p>
- value mixed - <p>New value</p>
mixed icms_properties_Handler::unserialize(mixed serialized)
Used when using with unserialize function call
- Visibility: public
- This method is defined by icms_properties_Handler
- serialized mixed