Overview

Namespaces

  • None
  • Xmf
    • Database
    • Module
      • Helper
    • Template
  • Xoops
    • Auth
    • Core
      • Cache
      • Database
        • Logging
        • Schema
      • Exception
      • Handler
        • Scheme
      • Kernel
        • Dtype
        • Handlers
        • Model
      • Lists
      • Locale
        • Punic
      • Service
        • Contract
      • Session
      • Text
        • Sanitizer
          • Extensions
      • Theme
        • Plugins
    • Form
    • Html
    • Locale
    • Module
      • Helper
      • Plugin

Classes

  • Criteria
  • CriteriaCompo
  • CriteriaElement
  • Dtype
  • XoopsModelAbstract
  • XoopsModelFactory
  • XoopsObject
  • XoopsObjectHandler
  • XoopsPersistableObjectHandler
  • Overview
  • Namespace
  • Class
  • Tree

Class XoopsObject

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

Xoops\Core\Kernel\XoopsObject implements ArrayAccess

Direct known subclasses

AvatarsAvatar, AvatarsUserlink, MenusMenus, NotificationsNotification, PagePage_content, PagePage_rating, PagePage_related, PagePage_related_link, PmMessage, ProfileCategory, ProfileField, ProfileProfile, BannersBanner, ProfileRegstep, ProfileVisibility, PublisherCategory, PublisherFile, PublisherItem, PublisherMimetype, PublisherRating, SmiliesSmiley, UserconfigsItem, UserconfigsOption, BannersBannerclient, UserrankRank, XlanguageLanguage, Xoops\Core\Kernel\Handlers\XoopsBlock, Xoops\Core\Kernel\Handlers\XoopsBlockModuleLink, Xoops\Core\Kernel\Handlers\XoopsConfigItem, Xoops\Core\Kernel\Handlers\XoopsConfigOption, Xoops\Core\Kernel\Handlers\XoopsGroup, Xoops\Core\Kernel\Handlers\XoopsGroupPerm, Xoops\Core\Kernel\Handlers\XoopsMembership, Xoops\Core\Kernel\Handlers\XoopsModule, CommentsComment, Xoops\Core\Kernel\Handlers\XoopsOnline, Xoops\Core\Kernel\Handlers\XoopsPrivateMessage, Xoops\Core\Kernel\Handlers\XoopsTplFile, Xoops\Core\Kernel\Handlers\XoopsTplSet, Xoops\Core\Kernel\Handlers\XoopsUser, XoopsObject, ImagesCategory, ImagesImage, ImagesImage_Body, ImagesImagebody, MenusMenu

Indirect known subclasses

ArtObject, XoopsBlock, XoopsPrivmessage, XoopsTplfile, XoopsTplset, XoopsUser, XoopsBlockmodulelink, XoopsConfigItem, XoopsConfigOption, XoopsGroup, XoopsGroupPerm, XoopsMembership, XoopsModule, XoopsOnline
Abstract
Namespace: Xoops\Core\Kernel
Package: Xoops\Core\Kernel
Category: Xoops\Core\Kernel\XoopsObject
Copyright: 2000-2015 XOOPS Project (http://xoops.org)
License: GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
Author: Kazumi Ono (AKA onokazu) <http://www.myweb.ne.jp/, http://jp.xoops.org/>
Author: Taiwen Jiang phppp@users.sourceforge.net
Since: 2.0.0
Link: http://xoops.org
Located at oops_lib/Xoops/Core/Kernel/XoopsObject.php
Methods summary
public
# setNew( )

used for new/clone objects

used for new/clone objects

public
# unsetNew( )

clear new flag

clear new flag

public boolean
# isNew( )

check new flag

check new flag

Returns

boolean
public
# setDirty( )

mark modified objects as dirty

mark modified objects as dirty

used for modified objects only

public
# unsetDirty( )

cleaar dirty flag

cleaar dirty flag

public boolean
# isDirty( )

check dirty flag

check dirty flag

Returns

boolean
public
# initVar( string $key, integer $data_type, mixed $value = null, boolean $required = false, mixed $maxlength = null, string $options = '' )

initialize variables for the object

initialize variables for the object

Parameters

$key
key
$data_type

set to one of Dtype::TYPE_XXX constants (set to Dtype::TYPE_OTHER if no data type checking nor text sanitizing is required)

$value
value
$required
require html form input?
$maxlength
for Dtype::TYPE_TEXT_BOX type only
$options
does this data have any select options?
public
# assignVar( string $key, mixed $value )

assign a value to a variable

assign a value to a variable

Parameters

$key
name of the variable to assign
$value
value to assign
public
# assignVars( array $var_arr )

assign values to multiple variables in a batch

assign values to multiple variables in a batch

Parameters

$var_arr
associative array of values to assign
public
# setVar( string $key, mixed $value )

assign a value to a variable

assign a value to a variable

Parameters

$key
name of the variable to assign
$value
value to assign
public
# setVars( array $var_arr )

assign values to multiple variables in a batch

assign values to multiple variables in a batch

Parameters

$var_arr
associative array of values to assign
public boolean
# destroyVars( mixed $var )

unset variable(s) for the object

unset variable(s) for the object

Parameters

$var
variable(s)

Returns

boolean
public
# setFormVars( mixed $var_arr = null, string $pref = 'xo_' )

Assign values to multiple variables in a batch

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

$var_arr
associative array of values to assign
$pref
prefix (only keys starting with the prefix will be set)
public array
# getVars( )

returns all variables for the object

returns all variables for the object

Returns

array
associative array of key->value pairs
public array
# getValues( mixed $keys = null, string $format = Xoops\Core\Kernel\Dtype::FORMAT_SHOW, integer $maxDepth = 1 )

Returns the values of the specified variables

Returns the values of the specified variables

Parameters

$keys
An array containing the names of the keys to retrieve, or null to get all of them
$format
Format to use (see getVar)
$maxDepth
Maximum level of recursion to use if some vars are objects themselves

Returns

array
associative array of key->value pairs
public mixed
# getVar( string $key, string $format = Xoops\Core\Kernel\Dtype::FORMAT_SHOW )

returns a specific variable for the object in a proper format

returns a specific variable for the object in a proper format

Parameters

$key
key of the object's variable to be returned
$format
format to use for the output

Returns

mixed
formatted value of the variable
public boolean
# cleanVars( )

clean values of all variables of the object for storage.

clean values of all variables of the object for storage.

Returns

boolean
true if successful
public
# registerFilter( string $filtername )

dynamically register additional filter for the object

dynamically register additional filter for the object

Parameters

$filtername
name of the filter
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

Parameters

$method
function or action name
public object
# xoopsClone( )

create a clone(copy) of the current object

create a clone(copy) of the current object

Returns

object
clone
public
# __clone( )

Adjust a newly cloned object

Adjust a newly cloned object

public
# setErrors( string $err_str )

add an error

add an error

Parameters

$err_str
to add
public array
# getErrors( )

return the errors for this object as an array

return the errors for this object as an array

Returns

array
an array of errors
public string
# getHtmlErrors( )

return the errors for this object as html

return the errors for this object as html

Returns

string
html listing the errors
public array
# toArray( )

toArray

toArray

Deprecated

Returns

array
public boolean
# offsetExists( mixed $offset )

offsetExists

offsetExists

Parameters

$offset
array key

Returns

boolean
true if offset exists

Implementation of

ArrayAccess::offsetExists()
public mixed
# offsetGet( mixed $offset )

offsetGet

offsetGet

Parameters

$offset
array key

Returns

mixed
value

Implementation of

ArrayAccess::offsetGet()
public
# offsetSet( mixed $offset, mixed $value )

offsetSet

offsetSet

Parameters

$offset
array key
$value

Implementation of

ArrayAccess::offsetSet()
public
# offsetUnset( mixed $offset )

offsetUnset

offsetUnset

Parameters

$offset
array key

Implementation of

ArrayAccess::offsetUnset()
Properties summary
public array $vars

holds all variables(properties) of an object

holds all variables(properties) of an object

# array()
public array $cleanVars

variables cleaned for store in DB

variables cleaned for store in DB

# array()
public string $plugin_path
#
API documentation generated by ApiGen