XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
XoopsObject Class Reference
Inheritance diagram for XoopsObject:
AbstractXoopsObject XoopsAvatar XoopsBlock XoopsCachetime XoopsComment XoopsComments XoopsConfigCategory XoopsConfigItem XoopsConfigOption XoopsGroup XoopsGroupPerm XoopsImage XoopsImagecategory XoopsImageset XoopsImagesetimg XoopsMembership XoopsModule XoopsNotification XoopsPrivmessage XoopsSubjecticon XoopsTimezone XoopsTplfile XoopsTplset XoopsUser

Public Member Functions

 __construct ()
 
 setNew ()
 
 unsetNew ()
 
 isNew ()
 
 setDirty ()
 
 unsetDirty ()
 
 isDirty ()
 
 initVar ($key, $data_type, $value=null, $required=false, $maxlength=null, $options='')
 
 assignVar ($key, $value)
 
 assignVars ($var_arr)
 
 setVar ($key, $value, $not_gpc=false)
 
 setVars ($var_arr, $not_gpc=false)
 
 setFormVars ($var_arr=null, $pref='xo_', $not_gpc=false)
 
getVars ()
 
getVar ($key, $format='s')
 
 getShow ($key)
 
 set ($key, $value)
 
 get ($key)
 
 getProperty ($key)
 
 getProperties ()
 
 cleanVars ()
 
 registerFilter ($filtername)
 
 _loadFilters ()
 
xoopsClone ()
 
 setErrors ($err_str)
 
 getErrors ()
 
 getHtmlErrors ()
 
- Public Member Functions inherited from AbstractXoopsObject
 initVar ($key, $data_type, $default, $required, $size)
 

Data Fields

 $vars = []
 
 $cleanVars = []
 
 $_isNew = false
 
 $_isDirty = false
 
 $_errors = []
 
 $_filters = []
 

Detailed Description

Definition at line 96 of file object.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ _loadFilters()

_loadFilters ( )

load all additional filters that have been registered to the object

@access private

Definition at line 594 of file object.php.

◆ assignVar()

assignVar ( $key,
$value )

assign a value to a variable

@access public

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

Definition at line 218 of file object.php.

◆ assignVars()

assignVars ( $var_arr)

assign values to multiple variables in a batch

@access private

Parameters
$var_arr

Reimplemented from AbstractXoopsObject.

Definition at line 232 of file object.php.

◆ cleanVars()

cleanVars ( )

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

Returns
bool true if successful @access public

Reimplemented in XoopsGroupPerm.

Definition at line 476 of file object.php.

◆ get()

get ( $key)

Reimplemented from AbstractXoopsObject.

Definition at line 437 of file object.php.

◆ getErrors()

getErrors ( )

return the errors for this object as an array

Returns
array an array of errors @access public

Definition at line 637 of file object.php.

◆ getHtmlErrors()

getHtmlErrors ( )

return the errors for this object as html

Returns
string html listing the errors @access public

Definition at line 648 of file object.php.

◆ getProperties()

getProperties ( )
Deprecated

Definition at line 460 of file object.php.

◆ getProperty()

getProperty ( $key)

Return value as raw.

Parameters
$key
Returns
Deprecated

Definition at line 452 of file object.php.

◆ getShow()

getShow ( $key)

Return html string for template. You can call get() method to get pure value.

Parameters
$key

Reimplemented from AbstractXoopsObject.

Definition at line 421 of file object.php.

◆ getVar()

& getVar ( $key,
$format = 's' )

returns a specific variable for the object in a proper format

@access 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 317 of file object.php.

◆ getVars()

& getVars ( )

returns all variables for the object

@access public

Returns
array associative array of key->value pairs

Definition at line 304 of file object.php.

◆ initVar()

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

#- initialize variables for the object

@access 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)
null$value
bool$requiredrequire html form input?
int$maxlengthfor XOBJ_DTYPE_TXTBOX type only
string$options

Definition at line 206 of file object.php.

◆ isDirty()

isDirty ( )

Definition at line 189 of file object.php.

◆ isNew()

isNew ( )
Returns
void

Reimplemented from AbstractXoopsObject.

Definition at line 169 of file object.php.

◆ registerFilter()

registerFilter ( $filtername)

dynamically register additional filter for the object

Parameters
string$filternamename of the filter @access public

Definition at line 584 of file object.php.

◆ set()

set ( $key,
$value )

Sets $value to $key property. This method calls setVar(), but make not_gpc true for the compatibility with XoopsSimpleObject.

Parameters
string$key
mixed$value

Reimplemented from AbstractXoopsObject.

Definition at line 432 of file object.php.

◆ setDirty()

setDirty ( )

#- #+ mark modified objects as dirty

used for modified objects only @access public

Definition at line 181 of file object.php.

◆ setErrors()

setErrors ( $err_str)

add an error

Parameters
$err_str@access public

Definition at line 626 of file object.php.

◆ setFormVars()

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

@access private

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

Definition at line 287 of file object.php.

◆ setNew()

setNew ( )

#+ used for new/clone objects

@access public

Reimplemented from AbstractXoopsObject.

Definition at line 161 of file object.php.

◆ 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

Definition at line 250 of file object.php.

◆ 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

Definition at line 268 of file object.php.

◆ unsetDirty()

unsetDirty ( )

Definition at line 185 of file object.php.

◆ unsetNew()

unsetNew ( )

Reimplemented from AbstractXoopsObject.

Definition at line 165 of file object.php.

◆ xoopsClone()

& xoopsClone ( )

create a clone(copy) of the current object

@access public

Returns
object clone

Definition at line 608 of file object.php.

Field Documentation

◆ $_errors

$_errors = []

Definition at line 137 of file object.php.

◆ $_filters

$_filters = []

additional filters registered dynamically by a child class object

@access private

Definition at line 144 of file object.php.

◆ $_isDirty

$_isDirty = false

Definition at line 129 of file object.php.

◆ $_isNew

$_isNew = false

Definition at line 121 of file object.php.

◆ $cleanVars

$cleanVars = []

Definition at line 113 of file object.php.

◆ $vars

$vars = []

Definition at line 105 of file object.php.


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