Base class for all objects in the Xoops kernel (and beyond)
| Methods | ||||||||
|---|---|---|---|---|---|---|---|---|
| 
					
	public
					
					
				 | __construct()
		constructor
	 constructor normally, this is called from child classes only Overriden by
 | # | ||||||
| 
					
	public
					
					
				 | XoopsObject()
		PHP 4 style constructor compatibility shim
	 PHP 4 style constructor compatibility shim Deprecatedall callers should be using parent::__construct() | # | ||||||
| 
					
	public
					
					
				 | setNew()
		*#@+
used for new/clone objects
	 *#@+ used for new/clone objects | # | ||||||
| 
					
	public
					
					
				 | unsetNew() | # | ||||||
| 
					
	public
					
					
				 | isNew(): bool | # | ||||||
| 
					
	public
					
					
				 | setDirty()
		*#@+
mark modified objects as dirty
	 *#@+ mark modified objects as dirty used for modified objects only | # | ||||||
| 
					
	public
					
					
				 | unsetDirty() | # | ||||||
| 
					
	public
					
					
				 | isDirty(): bool | # | ||||||
| 
					
	public
					
					
				 | initVar(
	string $key,
	int $data_type,
	mixed $value = null,
	bool $required = false,
	int|null $maxlength = null,
	string $options = '',
	string $enumerations = '',
): void
		initialize variables for the object
	 initialize variables for the object YOU SHOULD NOT USE THE $enumeration PARAMETER Parameters
 | # | ||||||
| 
					
	public
					
					
				 | assignVar(string $key, mixed $value)
		assign a value to a variable
	 assign a value to a variable Parameters
 | # | ||||||
| 
					
	public
					
					
				 | assignVars(array $var_arr)
		assign values to multiple variables in a batch
	 assign values to multiple variables in a batch Parameters
 | # | ||||||
| 
					
	public
					
					
				 | setVar(string $key, mixed $value, bool $not_gpc = false)
		assign a value to a variable
	 assign a value to a variable Parameters
 Overriden by | # | ||||||
| 
					
	public
					
					
				 | setVars(array $var_arr, bool $not_gpc = false)
		assign values to multiple variables in a batch
	 assign values to multiple variables in a batch Parameters
 | # | ||||||
| 
					
	public
					
					
				 | destroyVars(mixed $var): bool
		unset variable(s) for the object
	 unset variable(s) for the object | # | ||||||
| 
					
	public
					
					
				 | destoryVars(mixed $var): boolDeprecateduse destroyVars() instead, destoryVars() will be removed in the next major release | # | ||||||
| 
					
	public
					
					
				 | setFormVars(array $var_arr = null, string $pref = 'xo_', bool $not_gpc = false): void
		Assign values to multiple variables in a batch
	 Assign values to multiple variables in a batch Meant for a CGI context: 
 DeprecatedThis method will be removed in the next major XOOPS version Parameters
 | # | ||||||
| 
					
	public
					
					&
				 | getVars(): array
		returns all variables for the object
	 returns all variables for the object Returnsassociative array of key->value pairs | # | ||||||
| 
					
	public
					
					
				 | getValues(mixed $keys = null, string $format = 's', int $maxDepth = 1): array
		Returns the values of the specified variables
	 Returns the values of the specified variables Parameters
 Returnsassociative array of key->value pairs | # | ||||||
| 
					
	public
					
					
				 | getVar(string $key, string|null $format = null): mixed
		returns a specific variable for the object in a proper format
	 returns a specific variable for the object in a proper format YOU SHOULD NOT USE ANY OF THE UNICODE TYPES, THEY WILL BE REMOVED Parameters
 Returnsformatted value of the variable Overriden by | # | ||||||
| 
					
	public
					
					
				 | cleanVars(): bool
		clean values of all variables of the object for storage.
also add slashes wherever needed
	 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 Returnstrue if successful | # | ||||||
| 
					
	public
					
					
				 | registerFilter(string $filtername)
		dynamically register additional filter for the object
	 dynamically register additional filter for the object Deprecated\XoopsObject::registerFilter is deprecated since XOOPS 2.5.8 and will be removed in the next major release Parameters
 | # | ||||||
| 
					
	public
					
					
				 | _loadFilters()
		load all additional filters that have been registered to the object
	 load all additional filters that have been registered to the object | # | ||||||
| 
					
	public
					
					
				 | loadFilters(string $method)
		load all local filters for the object
	 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 Deprecated\XoopsObject::loadFilters is deprecated since XOOPS 2.5.8 and will be removed in the next major release Parameters
 | # | ||||||
| 
					
	public
					
					
				 | xoopsClone(): object
		create a clone(copy) of the current object
	 create a clone(copy) of the current object Returnsclone | # | ||||||
| 
					
	public
					
					
				 | __clone()
		Adjust a newly cloned object
	 Adjust a newly cloned object | # | ||||||
| 
					
	public
					
					
				 | getErrors(): array
		return the errors for this object as an array
	 return the errors for this object as an array Returnsan array of errors | # | ||||||
| 
					
	public
					
					
				 | getHtmlErrors(): string
		return the errors for this object as html
	 return the errors for this object as html Returnshtml listing the errors | # | ||||||
| 
					
	public
					
					
				 | toArray(): array
		Returns an array representation of the object
	 Returns an array representation of the object Deprecated, use getValues() directly | # | ||||||
| Properties | |||
|---|---|---|---|
| 
	public
					
					
				 | array | $vars = [] | # | 
| 
	public
					
					
				 | array | $cleanVars = [] | # | 
| 
	public
					
					
				 | bool | $_isNew = false | # | 
| 
	public
					
					
				 | bool | $_isDirty = false | # | 
| 
	public
					
					
				 | array | $_errors = [] | # | 
| 
	public
					
					
				 |  | $_filters = []
		additional filters registered dynamically by a child class object
	 additional filters registered dynamically by a child class object | # |