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 XoopsPersistableObjectHandler

XOOPS Kernel Persistable Object Handler class.

Xoops\Core\Kernel\XoopsObjectHandler
Extended by Xoops\Core\Kernel\XoopsPersistableObjectHandler

Direct known subclasses

AvatarsAvatarHandler, AvatarsUserlinkHandler, NotificationsNotificationHandler, PagePage_contentHandler, PagePage_ratingHandler, PagePage_related_linkHandler, PagePage_relatedHandler, PmMessageHandler, ProfileCategoryHandler, ProfileFieldHandler, ProfileProfileHandler, ProfileRegstepHandler, BannersBannerclientHandler, ProfileVisibilityHandler, PublisherCategoryHandler, PublisherFileHandler, PublisherItemHandler, PublisherMimetypeHandler, PublisherRatingHandler, SmiliesSmileyHandler, UserconfigsItemHandler, UserconfigsOptionHandler, UserrankRankHandler, BannersBannerHandler, XlanguageXlanguageHandler, Xoops\Core\Kernel\Handlers\XoopsBlockHandler, Xoops\Core\Kernel\Handlers\XoopsBlockModuleLinkHandler, Xoops\Core\Kernel\Handlers\XoopsConfigItemHandler, Xoops\Core\Kernel\Handlers\XoopsConfigOptionHandler, Xoops\Core\Kernel\Handlers\XoopsGroupHandler, Xoops\Core\Kernel\Handlers\XoopsGroupPermHandler, Xoops\Core\Kernel\Handlers\XoopsMembershipHandler, Xoops\Core\Kernel\Handlers\XoopsModuleHandler, Xoops\Core\Kernel\Handlers\XoopsOnlineHandler, CommentsCommentHandler, Xoops\Core\Kernel\Handlers\XoopsPrivateMessageHandler, Xoops\Core\Kernel\Handlers\XoopsTplFileHandler, Xoops\Core\Kernel\Handlers\XoopsTplSetHandler, Xoops\Core\Kernel\Handlers\XoopsUserHandler, XoopsPersistableObjectHandler, ImagesCategoryHandler, ImagesImagebodyHandler, ImagesImageHandler, MenusMenuHandler, MenusMenusHandler

Indirect known subclasses

ArtObjectHandler, PageGroupPermHandler, XoopsModuleHandler, XoopsOnlineHandler, XoopsPrivmessageHandler, XoopsTplfileHandler, XoopsTplsetHandler, XoopsUserHandler, PublisherGroupPermHandler, XoopsBlockHandler, XoopsBlockmodulelinkHandler, XoopsConfigItemHandler, XoopsConfigOptionHandler, XoopsGroupHandler, XoopsGroupPermHandler, XoopsMembershipHandler
Abstract
Namespace: Xoops\Core\Kernel
Package: Xoops\Core\Kernel
Category: Xoops\Core\Kernel\XoopsPersistableObjectHandler
Copyright: 2000-2015 XOOPS Project (http://xoops.org)
License: GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
Author: Taiwen Jiang phppp@users.sourceforge.net
Author: Jan Keller Pedersen mithrandir@xoops.org
Since: 2.0.0
Link: http://xoops.org
Located at oops_lib/Xoops/Core/Kernel/XoopsPersistableObjectHandler.php
Methods summary
protected
# __construct( Xoops\Core\Database\Connection $db = null, string $table = '', string $className = '', string $keyName = '', string $identifierName = '' )

Constructor

Constructor

Parameters

$db
database connection}
$table
Name of database table
$className
Name of Class, this handler is managing
$keyName
Name of the property holding the key
$identifierName

Name of the property holding an identifier name (title, name ...), used on getList()

Overrides

Xoops\Core\Kernel\XoopsObjectHandler::__construct()
public object|null
# setHandler( string|object $handler = null, array|null $args = null )

Set custom handler

Set custom handler

Parameters

$handler
handler
$args
arguments

Returns

object|null
public Xoops\Core\Kernel\XoopsModelAbstract
# loadHandler( string $name, mixed $args = null )

Load predefined handler

Load predefined handler

Parameters

$name
handler name
$args
args

Returns

Xoops\Core\Kernel\XoopsModelAbstract
handler
public mixed
# __call( string $name, array $args )

Magic method for overloading of delegation

Magic method for overloading of delegation

Parameters

$name
method name
$args
arguments

Returns

mixed
public Xoops\Core\Kernel\XoopsObject
# create( boolean $isNew = true )

create a new object

create a new object

Parameters

$isNew
Flag the new objects as new

Returns

Xoops\Core\Kernel\XoopsObject

Overrides

Xoops\Core\Kernel\XoopsObjectHandler::create()
public Xoops\Core\Kernel\XoopsObject|null
# get( mixed $id = null, array $fields = null )

Load an object from the database

Load an object from the database

Parameters

$id
ID
$fields
fields to fetch

Returns

Xoops\Core\Kernel\XoopsObject|null

Overrides

Xoops\Core\Kernel\XoopsObjectHandler::get()
public mixed
# insert( Xoops\Core\Kernel\XoopsObject $object, boolean $force = true )

insert an object into the database

insert an object into the database

Parameters

$object
object to insert
$force
flag to force the query execution despite security settings

Returns

mixed

Overrides

Xoops\Core\Kernel\XoopsObjectHandler::insert()
public boolean
# delete( Xoops\Core\Kernel\XoopsObject $object, boolean $force = false )

delete an object from the database

delete an object from the database

Parameters

$object
object to delete
$force
force delete

Returns

boolean
FALSE if failed.

Overrides

Xoops\Core\Kernel\XoopsObjectHandler::delete()
public boolean
# deleteAll( Xoops\Core\Kernel\CriteriaElement $criteria, boolean $force = true, boolean $asObject = false )

delete all objects matching the conditions

delete all objects matching the conditions

Parameters

$criteria
criteria to match
$force
force to delete
$asObject

delete in object way: instantiate all objects and delete one by one

Returns

boolean
public boolean
# updateAll( string $fieldname, mixed $fieldvalue, Xoops\Core\Kernel\CriteriaElement $criteria, boolean $force = false )

Change a field for objects with a certain criteria

Change a field for objects with a certain criteria

Parameters

$fieldname
Name of the field
$fieldvalue
Value to write
$criteria
criteria to match
$force
force to query

Returns

boolean
public array
# getObjects( Xoops\Core\Kernel\CriteriaElement $criteria = null, boolean $id_as_key = false, boolean $as_object = true )

Retrieve objects from the database

Retrieve objects from the database

Parameters

$criteria
criteria to match
$id_as_key
use the ID as key for the array
$as_object
return an array of objects

Returns

array
public array
# getAll( Xoops\Core\Kernel\CriteriaElement $criteria = null, array $fields = null, boolean $asObject = true, boolean $id_as_key = true )

get all objects matching a condition

get all objects matching a condition

Parameters

$criteria
criteria to match
$fields
variables to fetch
$asObject
flag indicating as object, otherwise as array
$id_as_key
use the ID as key for the array

Returns

array
of objects/array as requested by $asObject
public array
# getList( Xoops\Core\Kernel\CriteriaElement $criteria = null, integer $limit = 0, integer $start = 0 )

Retrieve a list of objects data

Retrieve a list of objects data

Parameters

$criteria
criteria to match
$limit
Max number of objects to fetch
$start
Which record to start at

Returns

array
public array
# getIds( Xoops\Core\Kernel\CriteriaElement $criteria = null )

get IDs of objects matching a condition

get IDs of objects matching a condition

Parameters

$criteria
criteria to match

Returns

array
of object IDs
public integer
# getCount( Xoops\Core\Kernel\CriteriaElement $criteria = null )

count objects matching a condition

count objects matching a condition

Parameters

$criteria
criteria to match

Returns

integer
count of objects
public array
# getCounts( Xoops\Core\Kernel\CriteriaElement $criteria = null )

Get counts of objects matching a condition

Get counts of objects matching a condition

Parameters

$criteria
criteria to match

Returns

array
of counts
public array
# getByLink( Xoops\Core\Kernel\CriteriaElement $criteria = null, array $fields = null, boolean $asObject = true, string $field_link = null, string $field_object = null )

get a list of objects matching a condition joint with another related object

get a list of objects matching a condition joint with another related object

Parameters

$criteria
criteria to match
$fields
variables to fetch
$asObject
flag indicating as object, otherwise as array
$field_link
field of linked object for JOIN
$field_object
field of current object for JOIN

Returns

array
as specified by $asObject
public integer
# getCountByLink( Xoops\Core\Kernel\CriteriaElement $criteria = null )

Count of objects matching a condition

Count of objects matching a condition

Parameters

$criteria
criteria to match

Returns

integer
count of objects
public integer
# getCountsByLink( Xoops\Core\Kernel\CriteriaElement $criteria = null )

array of count of objects matching a condition of, groupby linked object keyname

array of count of objects matching a condition of, groupby linked object keyname

Parameters

$criteria
criteria to match

Returns

integer
count of objects
public integer
# updateByLink( array $data, Xoops\Core\Kernel\CriteriaElement $criteria = null )

update objects matching a condition against linked objects

update objects matching a condition against linked objects

Parameters

$data
array of key => value
$criteria
criteria to match

Returns

integer
count of objects
public integer
# deleteByLink( Xoops\Core\Kernel\CriteriaElement $criteria = null )

Delete objects matching a condition against linked objects

Delete objects matching a condition against linked objects

Parameters

$criteria
criteria to match

Returns

integer
count of objects
public boolean
# cleanOrphan( string $table_link = '', string $field_link = '', string $field_object = '' )

Clean orphan objects against linked objects

Clean orphan objects against linked objects

Parameters

$table_link
table of linked object for JOIN
$field_link
field of linked object for JOIN
$field_object
field of current object for JOIN

Returns

boolean
true on success
public boolean
# synchronization( string $table_link = '', string $field_link = '', string $field_object = '' )

Synchronizing objects

Synchronizing objects

Parameters

$table_link
parent table
$field_link
primary key (parent table)
$field_object
foreign key (child table)

Returns

boolean
true on success
Properties summary
protected $handler

static protected

static protected

#
public string $table

Information about the class, the handler is managing

Information about the class, the handler is managing

#
public string $keyName
#
public string $className
#
public string $table_link
#
public string $identifierName
#
public string $field_link
#
public string $field_object
#
public string $keyName_link
#
Properties inherited from Xoops\Core\Kernel\XoopsObjectHandler
$db2
API documentation generated by ApiGen