API - XOOPS 2.5.11 Beta 2
By monxoops.fr
XoopsObject Class Reference
Inheritance diagram for XoopsObject:

Public Member Functions

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

Data Fields

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

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ __clone()

__clone ( )

Adjust a newly cloned object

Here is the call graph for this function:

◆ _loadFilters()

_loadFilters ( )

load all additional filters that have been registered to the object

@access private

Here is the caller graph for this function:

◆ assignVar()

assignVar (   $key,
  $value 
)

assign a value to a variable

@access public

Parameters
string$keyname of the variable to assign
mixed$valuevalue to assign
Here is the call graph for this function:
Here is the caller graph for this function:

◆ assignVars()

assignVars (   $var_arr)

assign values to multiple variables in a batch

@access private

Parameters
array$var_arrassociative array of values to assign
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cleanVars()

cleanVars ( )

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

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

Returns
bool true if successful @access public
Here is the call graph for this function:
Here is the caller graph for this function:

◆ destoryVars()

destoryVars (   $var)
Parameters
$var
Returns
bool
Deprecated:
use destroyVars() instead, destoryVars() will be removed in the next major release
Here is the call graph for this function:

◆ destroyVars()

destroyVars (   $var)

unset variable(s) for the object

@access public

Parameters
mixed$var
Returns
bool
Here is the caller graph for this function:

◆ getErrors()

getErrors ( )

return the errors for this object as an array

Returns
array an array of errors @access public
Here is the caller graph for this function:

◆ getHtmlErrors()

getHtmlErrors ( )

return the errors for this object as html

Returns
string html listing the errors @access public

◆ getValues()

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
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getVar()

getVar (   $key,
  $format = null 
)

returns a specific variable for the object in a proper format

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

@access public

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

Reimplemented in ProfileField.

Here is the call graph for this function:

◆ getVars()

& getVars ( )

returns all variables for the object

@access public

Returns
array associative array of key->value pairs

◆ initVar()

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

initialize variables for the object

YOU SHOULD NOT USE THE $enumeration PARAMETER

@access public

Parameters
string$key
int$data_typeset to one of XOBJ_DTYPE_XXX constants (set to XOBJ_DTYPE_OTHER if no data type checking nor text sanitizing is required)
mixed$value
bool$requiredrequire html form input?
int | null$maxlengthfor XOBJ_DTYPE_TXTBOX type only
string$options
string$enumerations
Returns
void
Here is the caller graph for this function:

◆ isDirty()

isDirty ( )
Returns
bool
Here is the caller graph for this function:

◆ isNew()

isNew ( )
Returns
bool
Here is the caller graph for this function:

◆ loadFilters()

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
Deprecated:
\XoopsObject::loadFilters is deprecated since XOOPS 2.5.8 and will be removed in the next major release
Here is the call graph for this function:

◆ registerFilter()

registerFilter (   $filtername)

dynamically register additional filter for the object

Parameters
string$filternamename of the filter
Deprecated:
\XoopsObject::registerFilter is deprecated since XOOPS 2.5.8 and will be removed in the next major release

◆ setDirty()

setDirty ( )

*#+ mark modified objects as dirty

used for modified objects only

@access public

Here is the caller graph for this function:

◆ setErrors()

setErrors (   $err_str)

add an error

Parameters
$err_str
Here is the caller graph for this function:

◆ setFormVars()

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

Assign values to multiple variables in a batch

Meant for a CGI context:

  • prefixed CGI args are considered save
  • avoids polluting of namespace with CGI args
Parameters
array$var_arrassociative array of values to assign
string$prefprefix (only keys starting with the prefix will be set)
bool$not_gpc
Returns
void
Deprecated:
This method will be removed in the next major XOOPS version
Here is the call graph for this function:

◆ setNew()

setNew ( )

*#+ used for new/clone objects

@access public

Here is the caller graph for this function:

◆ setVar()

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

assign a value to a variable

@access public

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

Reimplemented in ProfileField.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setVars()

setVars (   $var_arr,
  $not_gpc = false 
)

assign values to multiple variables in a batch

@access private

Parameters
array$var_arrassociative array of values to assign
bool$not_gpc
Here is the call graph for this function:

◆ toArray()

toArray ( )

Returns an array representation of the object

Deprecated, use getValues() directly

Returns
array
Here is the call graph for this function:

◆ unsetDirty()

unsetDirty ( )
Here is the caller graph for this function:

◆ unsetNew()

unsetNew ( )
Here is the caller graph for this function:

◆ xoopsClone()

xoopsClone ( )

create a clone(copy) of the current object

@access public

Returns
object clone

◆ XoopsObject()

PHP 4 style constructor compatibility shim

Deprecated:
all callers should be using parent::__construct()
Here is the call graph for this function:

Field Documentation

◆ $_errors

$_errors = array()

◆ $_filters

$_filters = array()

additional filters registered dynamically by a child class object

@access private

◆ $_isDirty

$_isDirty = false

◆ $_isNew

$_isNew = false

◆ $cleanVars

$cleanVars = array()

◆ $vars

$vars = array()

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