XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
XoopsObject Class Reference
Inheritance diagram for XoopsObject:
Inheritance graph

Public Member Functions

 _loadFilters ()
 
 assignVar ($key, $value)
 
 assignVars ($var_arr)
 
 cleanVars ()
 
 destoryVars ($var)
 
 getErrors ()
 
 getHtmlErrors ()
 
 getValues ($keys=null, $format= 's', $maxDepth=1)
 
 getVar ($key, $format= 's')
 
getVars ()
 
 initVar ($key, $data_type, $value=null, $required=false, $maxlength=null, $options= '', $enumerations= '')
 
 isDirty ()
 
 isNew ()
 
 loadFilters ($method)
 
 registerFilter ($filtername)
 
 setDirty ()
 
 setErrors ($err_str)
 
 setFormVars ($var_arr=null, $pref= 'xo_', $not_gpc=false)
 
 setNew ()
 
 setVar ($key, $value, $not_gpc=false)
 
 setVars ($var_arr, $not_gpc=false)
 
 toArray ()
 
 unsetDirty ()
 
 unsetNew ()
 
xoopsClone ()
 
 XoopsObject ()
 

Public Attributes

 $_errors = array()
 
 $_filters = array()
 
 $_isDirty = false
 
 $_isNew = false
 
 $cleanVars = array()
 
 $vars = array()
 

Detailed Description

Base class for all objects in the Xoops kernel (and beyond)

Definition at line 58 of file object.php.

Member Function Documentation

XoopsObject::_loadFilters ( )

load all additional filters that have been registered to the object

private

Definition at line 839 of file object.php.

References $file, and $path.

XoopsObject::assignVar (   $key,
  $value 
)

assign a value to a variable

public

Parameters
string$keyname of the variable to assign
mixed$valuevalue to assign

Definition at line 185 of file object.php.

References _DBDATESTRING, _DBTIMESTAMPSTRING, _DBTIMESTRING, and xoops_convert_decode().

Here is the call graph for this function:

XoopsObject::assignVars (   $var_arr)

assign values to multiple variables in a batch

private

Parameters
array$var_arrayassociative array of values to assign

Definition at line 237 of file object.php.

XoopsObject::cleanVars ( )

clean values of all variables of the object for storage. also add slashes whereever needed

YOU SHOULD NOT USE ANY OF THE UNICODE TYPES, THEY WILL BE REMOVED

Returns
bool true if successful public

Definition at line 645 of file object.php.

References _DBDATESTRING, _DBTIMESTAMPSTRING, _DBTIMESTRING, _XOBJ_ERR_REQUIRED, _XOBJ_ERR_SHORTERTHAN, MyTextSanitizer\getInstance(), and xoops_convert_encode().

Here is the call graph for this function:

XoopsObject::destoryVars (   $var)

unset variable(s) for the object

public

Parameters
mixed$var

Definition at line 282 of file object.php.

References $var.

XoopsObject::getErrors ( )

return the errors for this object as an array

Returns
array an array of errors public

Definition at line 936 of file object.php.

XoopsObject::getHtmlErrors ( )

return the errors for this object as html

Returns
string html listing the errors public

Definition at line 947 of file object.php.

References $error, and $ret.

XoopsObject::getValues (   $keys = null,
  $format = 's',
  $maxDepth = 1 
)

Returns the values of the specified variables

Parameters
mixed$keysAn array containing the names of the keys to retrieve, or null to get all of them
string$formatFormat to use (see getVar)
int$maxDepthMaximum level of recursion to use if some vars are objects themselves
Returns
array associative array of key->value pairs

Definition at line 337 of file object.php.

References $vars.

XoopsObject::getVar (   $key,
  $format = 's' 
)

returns a specific variable for the object in a proper format

YOU SHOULD NOT USE ANY OF THE UNICODE TYPES, THEY WILL BE REMOVED

public

Parameters
string$keykey of the object's variable to be returned
string$formatformat to use for the output
Returns
mixed formatted value of the variable

Definition at line 367 of file object.php.

References $html, $i, $image, $op, $options, $ret, _DBDATESTRING, _DBTIMESTAMPSTRING, _DBTIMESTRING, and MyTextSanitizer\getInstance().

Referenced by PmMessageHandler\sendEmail().

Here is the call graph for this function:

Here is the caller graph for this function:

& XoopsObject::getVars ( )

returns all variables for the object

public

Returns
array associative array of key->value pairs

Definition at line 324 of file object.php.

References $vars.

XoopsObject::initVar (   $key,
  $data_type,
  $value = null,
  $required = false,
  $maxlength = null,
  $options = '',
  $enumerations = '' 
)

initialize variables for the object

YOU SHOULD NOT USE THE $enumeration PARAMETER

public

Parameters
string$key
int$data_typeset to one of XOBJ_DTYPE_XXX constants (set to XOBJ_DTYPE_OTHER if no data type ckecking nor text sanitizing is required)
mixed$
bool$requiredrequire html form input?
int$maxlengthfor XOBJ_DTYPE_TXTBOX type only
string$optiondoes this data have any select options?
string$enumerationarray for XOBJ_DTYPE_ENUM type only

Definition at line 173 of file object.php.

References $options.

Referenced by PmMessage\__construct(), XoopsCacheModelObject\__construct(), XoopsMembership\XoopsMembership(), and XoopsRank\XoopsRank().

Here is the caller graph for this function:

XoopsObject::isDirty ( )

Definition at line 154 of file object.php.

XoopsObject::isNew ( )

Definition at line 133 of file object.php.

XoopsObject::loadFilters (   $method)

load all local filters for the object

Filter distribution: In each module folder there is a folder "filter" containing filter files with, filename: [name_of_target_class][.][function/action_name][.php]; function name: [dirname][_][name_of_target_class][_][function/action_name]; parameter: the target object

Parameters
string$methodfunction or action name public

Definition at line 870 of file object.php.

References $dirname, $file, $method, $module_handler, XoopsCache\read(), XoopsCache\write(), xoops_gethandler(), and xoops_load().

Here is the call graph for this function:

XoopsObject::registerFilter (   $filtername)

dynamically register additional filter for the object

Parameters
string$filternamename of the filter public

Definition at line 829 of file object.php.

XoopsObject::setDirty ( )

*#@+ mark modified objects as dirty

used for modified objects only

public

Definition at line 146 of file object.php.

XoopsObject::setErrors (   $err_str)

add an error

Parameters
string$valueerror to add public

Definition at line 921 of file object.php.

XoopsObject::setFormVars (   $var_arr = null,
  $pref = 'xo_',
  $not_gpc = false 
)

Assign values to multiple variables in a batch

Meant for a CGI contenxt:

  • prefixed CGI args are considered save
  • avoids polluting of namespace with CGI args

private

Parameters
array$var_arrassociative array of values to assign
string$prefprefix (only keys starting with the prefix will be set)

Definition at line 308 of file object.php.

XoopsObject::setNew ( )

*#@+ used for new/clone objects

public

Definition at line 125 of file object.php.

XoopsObject::setVar (   $key,
  $value,
  $not_gpc = false 
)

assign a value to a variable

public

Parameters
string$keyname of the variable to assign
mixed$valuevalue to assign
bool$not_gpc

Definition at line 252 of file object.php.

XoopsObject::setVars (   $var_arr,
  $not_gpc = false 
)

assign values to multiple variables in a batch

private

Parameters
array$var_arrassociative array of values to assign
bool$not_gpc

Definition at line 269 of file object.php.

XoopsObject::toArray ( )

Returns an array representation of the object

Deprecated, use getValues() directly

Returns
array

Definition at line 967 of file object.php.

XoopsObject::unsetDirty ( )

Definition at line 150 of file object.php.

XoopsObject::unsetNew ( )

Definition at line 129 of file object.php.

& XoopsObject::xoopsClone ( )

create a clone(copy) of the current object

public

Returns
object clone

Definition at line 902 of file object.php.

XoopsObject::XoopsObject ( )

constructor

normally, this is called from child classes only

public

Definition at line 115 of file object.php.

Referenced by PmMessage\__construct(), XoopsMembership\XoopsMembership(), and XoopsRank\XoopsRank().

Here is the caller graph for this function:

Member Data Documentation

XoopsObject::$_errors = array()

Definition at line 98 of file object.php.

XoopsObject::$_filters = array()

additional filters registered dynamically by a child class object

private

Definition at line 105 of file object.php.

XoopsObject::$_isDirty = false

Definition at line 90 of file object.php.

XoopsObject::$_isNew = false

Definition at line 82 of file object.php.

XoopsObject::$cleanVars = array()

Definition at line 74 of file object.php.

XoopsObject::$vars = array()

Definition at line 66 of file object.php.


The documentation for this class was generated from the following file: