XOOPS  2.6.0
Xoops\Core\Kernel\XoopsObject Class Reference
Inheritance diagram for Xoops\Core\Kernel\XoopsObject:
Inheritance graph

Public Member Functions

 assignVar ($key, $value)
 
 assignVars ($var_arr)
 
 cleanVars ($quote=true)
 
 destroyVars ($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= '')
 
 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 ()
 

Public Attributes

 $cleanVars = array()
 
 $plugin_path
 
 $vars = array()
 

Private Member Functions

 _loadFilters ()
 

Private Attributes

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

Detailed Description

Definition at line 47 of file XoopsObject.php.

Member Function Documentation

Xoops\Core\Kernel\XoopsObject::_loadFilters ( )
private

load all additional filters that have been registered to the object

Returns
void

Definition at line 398 of file XoopsObject.php.

References $file, $path, Xoops\Core\Kernel\XoopsObject\$plugin_path, and XoopsLoad\fileExists().

Referenced by Xoops\Core\Kernel\XoopsObject\loadFilters().

Here is the call graph for this function:

Here is the caller graph for this function:

Xoops\Core\Kernel\XoopsObject::assignVar (   $key,
  $value 
)

assign a value to a variable

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

Definition at line 192 of file XoopsObject.php.

Referenced by XoopsBlock\__construct(), XoopsUser\__construct(), Xoops\Core\Kernel\XoopsObject\assignVars(), Xoops\Core\Kernel\Model\Write\insert(), and XoopsTplfileHandler\insertTpl().

Here is the caller graph for this function:

Xoops\Core\Kernel\XoopsObject::assignVars (   $var_arr)

assign values to multiple variables in a batch

Parameters
array$var_arrassociative array of values to assign
Returns
void

Definition at line 206 of file XoopsObject.php.

References Xoops\Core\Kernel\XoopsObject\assignVar().

Referenced by XoopsBlock\__construct(), and XoopsUser\__construct().

Here is the call graph for this function:

Here is the caller graph for this function:

Xoops\Core\Kernel\XoopsObject::cleanVars (   $quote = true)

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

Parameters
bool$quoteadd quotes for db storage
Returns
bool true if successful public

Definition at line 361 of file XoopsObject.php.

References Xoops\Core\Kernel\Dtype\cleanVar(), Xoops\Core\Kernel\XoopsObject\getErrors(), MyTextSanitizer\getInstance(), and Xoops\Core\Kernel\XoopsObject\unsetDirty().

Referenced by Xoops\Core\Kernel\Model\Write\cleanVars(), XoopsTplfileHandler\forceUpdate(), Xoops\Core\Kernel\Model\Write\insert(), and XoopsTplfileHandler\insertTpl().

Here is the call graph for this function:

Here is the caller graph for this function:

Xoops\Core\Kernel\XoopsObject::destroyVars (   $var)

unset variable(s) for the object

Parameters
mixed$varvariable(s)
Returns
bool

Definition at line 254 of file XoopsObject.php.

References $var.

Xoops\Core\Kernel\XoopsObject::getErrors ( )

return the errors for this object as an array

Returns
array an array of errors public

Definition at line 490 of file XoopsObject.php.

References Xoops\Core\Kernel\XoopsObject\$_errors.

Referenced by Xoops\Core\Kernel\Model\Write\cleanVars(), and Xoops\Core\Kernel\XoopsObject\cleanVars().

Here is the caller graph for this function:

Xoops\Core\Kernel\XoopsObject::getHtmlErrors ( )

return the errors for this object as html

Returns
string html listing the errors public
Todo:
remove harcoded strings

Definition at line 502 of file XoopsObject.php.

References $error.

Referenced by Xoops\Auth\Provisioning\change(), and Xoops\Core\Kernel\Model\Write\insert().

Here is the caller graph for this function:

Xoops\Core\Kernel\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 312 of file XoopsObject.php.

References $keys, Xoops\Core\Kernel\XoopsObject\$vars, and Xoops\Core\Kernel\XoopsObject\getVar().

Referenced by Xoops\Core\Kernel\XoopsObject\toArray().

Here is the call graph for this function:

Here is the caller graph for this function:

Xoops\Core\Kernel\XoopsObject::getVar (   $key,
  $format = 's' 
)

returns a specific variable for the object in a proper format

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 342 of file XoopsObject.php.

References Xoops\Core\Kernel\Dtype\getVar().

Referenced by AvatarsAvatar_userForm\__construct(), ImagesImageForm\__construct(), AvatarsAvatarForm\__construct(), CommentsCommentForm\__construct(), ImagesCategoryForm\__construct(), SmiliesSmiliesForm\__construct(), UserrankRanksForm\__construct(), MenusMenus_menuForm\__construct(), MenusMenus_menusForm\__construct(), SystemUserForm\__construct(), SystemGroupForm\__construct(), XoopsMemberHandler\activateUser(), XoopsUser\actkey(), XoopsUser\attachsig(), AvatarsAvatar\avatar_created(), AvatarsAvatar\avatar_display(), AvatarsAvatar\avatar_file(), AvatarsAvatar\avatar_id(), AvatarsAvatar\avatar_mimetype(), AvatarsAvatar\avatar_name(), AvatarsAvatar\avatar_type(), AvatarsAvatar\avatar_weight(), XoopsBlock\bcachetime(), XoopsBlock\bid(), XoopsUser\bio(), XoopsBlock\block_type(), XoopsBlock\buildBlock(), XoopsBlock\c_type(), XoopsConfigItem\conf_catid(), UserconfigsItem\conf_desc(), XoopsConfigItem\conf_desc(), UserconfigsItem\conf_formtype(), XoopsConfigItem\conf_formtype(), UserconfigsItem\conf_id(), XoopsConfigItem\conf_id(), XoopsConfigOption\conf_id(), UserconfigsOption\conf_id(), UserconfigsItem\conf_modid(), XoopsConfigItem\conf_modid(), UserconfigsItem\conf_name(), XoopsConfigItem\conf_name(), UserconfigsItem\conf_order(), XoopsConfigItem\conf_order(), UserconfigsItem\conf_title(), XoopsConfigItem\conf_title(), UserconfigsItem\conf_uid(), UserconfigsItem\conf_value(), XoopsConfigItem\conf_value(), UserconfigsItem\conf_valuetype(), XoopsConfigItem\conf_valuetype(), XoopsConfigOption\confop_id(), UserconfigsOption\confop_id(), XoopsConfigOption\confop_name(), UserconfigsOption\confop_name(), XoopsConfigOption\confop_value(), UserconfigsOption\confop_value(), XoopsBlock\content(), UserconfigsConfigHandler\createDefaultUserConfigs(), createThemeform(), Xoops\Core\Kernel\Model\Write\delete(), XoopsBlockHandler\deleteBlock(), SystemModule\deleteBlocks(), UserconfigsConfigHandler\deleteConfig(), XoopsConfigHandler\deleteConfig(), SystemModule\deleteConfigs(), XoopsMemberHandler\deleteGroup(), XoopsModuleHandler\deleteModule(), Notifications\deleteModuleRelations(), Comments\deleteModuleRelations(), SystemModule\deleteTemplates(), XoopsTplfileHandler\deleteTpl(), XoopsMemberHandler\deleteUser(), XoopsGroup\description(), XoopsBlock\dirname(), XoopsModule\dirname(), XoopsBlock\edit_func(), XoopsUser\email(), XoopsPrivmessage\from_userid(), XoopsBlock\func_file(), XoopsBlock\func_num(), GravatarsProvider\getAvatarEditUrl(), UserconfigsItem\getConfValueForOutput(), XoopsConfigItem\getConfValueForOutput(), XoopsBlock\getContent(), UserconfigsConfigsForm\getForm(), SystemPreferencesForm\getForm(), XoopsUser\getGroups(), XoopsModule\getInfo(), XoopsTplfile\getLastModified(), XoopsBlock\getOptions(), Notifications\getPluginableConfigs(), XoopsTplfile\getSource(), AvatarsAvatarHandler\getUser(), Xoops\Core\Kernel\XoopsObject\getValues(), XoopsGroupPerm\gperm_groupid(), XoopsGroupPerm\gperm_id(), XoopsGroupPerm\gperm_itemid(), XoopsGroupPerm\gperm_modid(), XoopsGroupPerm\gperm_name(), XoopsGroup\group_type(), XoopsGroup\groupid(), XoopsModule\hasadmin(), XoopsModule\hascomments(), XoopsModule\hasconfig(), XoopsModule\hasmain(), XoopsModule\hasnotification(), XoopsModule\hassearch(), XoopsGroup\id(), XoopsConfigOption\id(), UserconfigsOption\id(), XoopsTplset\id(), XoopsPrivmessage\id(), XoopsGroupPerm\id(), UserconfigsItem\id(), XoopsTplfile\id(), AvatarsAvatar\id(), XoopsConfigItem\id(), XoopsBlock\id(), XoopsUser\id(), XoopsModule\id(), XoopsUser\incrementPost(), Xoops\Core\Kernel\Model\Write\insert(), UserconfigsConfigHandler\insertConfig(), XoopsConfigHandler\insertConfig(), XoopsModuleHandler\insertModule(), Notifications\insertModuleRelations(), Comments\insertModuleRelations(), SystemModule\installBlocks(), SystemModule\installconfigs(), SystemModule\installTemplates(), XoopsBlock\isactive(), XoopsUser\isActive(), XoopsModule\isactive(), XoopsBlock\isCustom(), XoopsUser\isOnline(), CommentsComment\isRoot(), XoopsBlock\last_modified(), XoopsModule\last_update(), XoopsUser\level(), XoopsMembership\linkid(), XoopsModule\mainLink(), XoopsBlock\mid(), XoopsModule\mid(), XoopsPrivmessage\msg_id(), XoopsPrivmessage\msg_image(), XoopsPrivmessage\msg_text(), XoopsPrivmessage\msg_time(), XoopsGroup\name(), XoopsBlock\name(), XoopsUser\name(), XoopsModule\name(), XoopsUser\notify_method(), XoopsUser\notify_mode(), NotificationsNotification\notifyUser(), XoopsOnline\online_ip(), XoopsOnline\online_module(), XoopsOnline\online_uid(), XoopsOnline\online_uname(), XoopsOnline\online_updated(), XoopsBlock\options(), XoopsUser\pass(), XoopsUser\posts(), XoopsUser\rank(), XoopsRanks\rank_id(), XoopsRanks\rank_image(), XoopsRanks\rank_max(), XoopsRanks\rank_min(), XoopsRanks\rank_special(), XoopsRanks\rank_title(), XoopsPrivmessage\read_msg(), UserconfigsItem\setConfValueForInput(), XoopsConfigItem\setConfValueForInput(), XoopsPrivmessageHandler\setRead(), XoopsBlock\show_func(), XoopsBlock\side(), XoopsPrivmessage\subject(), XoopsBlock\template(), XoopsUser\theme(), XoopsUser\timezone(), XoopsBlock\title(), XoopsPrivmessage\to_userid(), XoopsTplfile\tpl_desc(), XoopsTplfile\tpl_file(), XoopsTplfile\tpl_id(), XoopsTplfile\tpl_lastimported(), XoopsTplfile\tpl_lastmodified(), XoopsTplfile\tpl_module(), XoopsTplfile\tpl_refid(), XoopsTplfile\tpl_source(), XoopsTplfile\tpl_tplset(), XoopsTplfile\tpl_type(), XoopsTplset\tplset_created(), XoopsTplset\tplset_credits(), XoopsTplset\tplset_desc(), XoopsTplset\tplset_id(), XoopsTplset\tplset_name(), XoopsMembership\uid(), XoopsUser\uid(), XoopsUser\umode(), XoopsUser\uname(), XoopsUser\uorder(), MenusMenuHandler\update_weights(), XoopsUser\url(), XoopsUser\user_aim(), XoopsUser\user_avatar(), XoopsUser\user_from(), XoopsUser\user_icq(), XoopsUser\user_intrest(), XoopsUser\user_msnm(), XoopsUser\user_occ(), XoopsUser\user_regdate(), XoopsUser\user_sig(), XoopsUser\user_viewemail(), XoopsUser\user_yim(), XoopsModule\version(), XoopsBlock\visible(), XoopsBlock\weight(), XoopsModule\weight(), xoops_module_update_search(), and xoops_module_update_system().

Here is the call graph for this function:

Xoops\Core\Kernel\XoopsObject::getVars ( )

returns all variables for the object

public

Returns
array associative array of key->value pairs

Definition at line 298 of file XoopsObject.php.

References Xoops\Core\Kernel\XoopsObject\$vars.

Referenced by Xoops\Core\Kernel\Model\Write\cleanVars().

Here is the caller graph for this function:

Xoops\Core\Kernel\XoopsObject::initVar (   $key,
  $data_type,
  $value = null,
  $required = false,
  $maxlength = null,
  $options = '' 
)

initialize variables for the object

Parameters
string$keykey
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$valuevalue
bool$requiredrequire html form input?
mixed$maxlengthfor XOBJ_DTYPE_TXTBOX type only
string$optionsdoes this data have any select options?
Returns
void

Definition at line 172 of file XoopsObject.php.

References $options.

Referenced by AvatarsUserlink\__construct(), ImagesImagebody\__construct(), MenusMenus\__construct(), MenusMenu\__construct(), SmiliesSmiley\__construct(), ImagesImage\__construct(), ImagesCategory\__construct(), XoopsBlockmodulelink\__construct(), XoopsRanks\__construct(), CommentsComment\__construct(), XoopsBlock\__construct(), XoopsMembership\__construct(), XoopsGroup\__construct(), XoopsPrivmessage\__construct(), XoopsOnline\__construct(), NotificationsNotification\__construct(), XoopsConfigOption\__construct(), UserconfigsOption\__construct(), XoopsTplset\__construct(), XoopsTplfile\__construct(), XoopsGroupPerm\__construct(), UserconfigsItem\__construct(), AvatarsAvatar\__construct(), ImagesImage_Body\__construct(), XoopsConfigItem\__construct(), XoopsModule\__construct(), and XoopsUser\__construct().

Here is the caller graph for this function:

Xoops\Core\Kernel\XoopsObject::isDirty ( )

check dirty flag

Returns
bool

Definition at line 154 of file XoopsObject.php.

References Xoops\Core\Kernel\XoopsObject\$_isDirty.

Referenced by XoopsTplfileHandler\forceUpdate(), Xoops\Core\Kernel\Model\Write\insert(), and XoopsTplfileHandler\insertTpl().

Here is the caller graph for this function:

Xoops\Core\Kernel\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
Returns
void

Definition at line 430 of file XoopsObject.php.

References $dirname, $file, $modules_active, Xoops\Core\Kernel\XoopsObject\_loadFilters(), XoopsLoad\fileExists(), XoopsBaseConfig\get(), and Xoops\getInstance().

Here is the call graph for this function:

Xoops\Core\Kernel\XoopsObject::registerFilter (   $filtername)

dynamically register additional filter for the object

Parameters
string$filternamename of the filter
Returns
void

Definition at line 388 of file XoopsObject.php.

Xoops\Core\Kernel\XoopsObject::setDirty ( )

mark modified objects as dirty

used for modified objects only

public

Returns
void

Definition at line 134 of file XoopsObject.php.

Referenced by Xoops\Core\Kernel\XoopsObject\setVar().

Here is the caller graph for this function:

Xoops\Core\Kernel\XoopsObject::setErrors (   $err_str)
Xoops\Core\Kernel\XoopsObject::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
mixed$var_arrassociative array of values to assign
string$prefprefix (only keys starting with the prefix will be set)
bool$not_gpcnot gpc
Returns
void

Definition at line 282 of file XoopsObject.php.

References Xoops\Core\Kernel\XoopsObject\setVar().

Here is the call graph for this function:

Xoops\Core\Kernel\XoopsObject::setNew ( )

used for new/clone objects

Returns
void

Definition at line 101 of file XoopsObject.php.

Xoops\Core\Kernel\XoopsObject::setVar (   $key,
  $value,
  $not_gpc = false 
)
Xoops\Core\Kernel\XoopsObject::setVars (   $var_arr,
  $not_gpc = false 
)

assign values to multiple variables in a batch

Parameters
array$var_arrassociative array of values to assign
bool$not_gpcnot gpc
Returns
void

Definition at line 240 of file XoopsObject.php.

References Xoops\Core\Kernel\XoopsObject\setVar().

Here is the call graph for this function:

Xoops\Core\Kernel\XoopsObject::toArray ( )

toArray

Deprecated:
Returns
array

Definition at line 521 of file XoopsObject.php.

References Xoops\Core\Kernel\XoopsObject\getValues().

Here is the call graph for this function:

Xoops\Core\Kernel\XoopsObject::unsetDirty ( )

cleaar dirty flag

Returns
void

Definition at line 144 of file XoopsObject.php.

Referenced by Xoops\Core\Kernel\Model\Write\cleanVars(), and Xoops\Core\Kernel\XoopsObject\cleanVars().

Here is the caller graph for this function:

Xoops\Core\Kernel\XoopsObject::unsetNew ( )

clear new flag

Returns
void

Definition at line 111 of file XoopsObject.php.

Referenced by Xoops\Core\Kernel\Model\Write\insert(), CommentsCommentHandler\updateByField(), and NotificationsNotificationHandler\updateByField().

Here is the caller graph for this function:

Xoops\Core\Kernel\XoopsObject::xoopsClone ( )

create a clone(copy) of the current object

public

Returns
object clone

Definition at line 454 of file XoopsObject.php.

Member Data Documentation

Xoops\Core\Kernel\XoopsObject::$_errors = array()
private

Definition at line 82 of file XoopsObject.php.

Referenced by Xoops\Core\Kernel\XoopsObject\getErrors().

Xoops\Core\Kernel\XoopsObject::$_filters = array()
private

Definition at line 89 of file XoopsObject.php.

Xoops\Core\Kernel\XoopsObject::$_isDirty = false
private

Definition at line 75 of file XoopsObject.php.

Referenced by Xoops\Core\Kernel\XoopsObject\isDirty().

Xoops\Core\Kernel\XoopsObject::$_isNew = false
private

Definition at line 68 of file XoopsObject.php.

Referenced by Xoops\Core\Kernel\XoopsObject\isNew().

Xoops\Core\Kernel\XoopsObject::$cleanVars = array()

Definition at line 61 of file XoopsObject.php.

Xoops\Core\Kernel\XoopsObject::$plugin_path

Definition at line 94 of file XoopsObject.php.

Referenced by Xoops\Core\Kernel\XoopsObject\_loadFilters().

Xoops\Core\Kernel\XoopsObject::$vars = array()

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