API - XOOPS 2.5.11 Beta 2
By monxoops.fr
XoopsPersistableObjectHandler Class Reference
Inheritance diagram for XoopsPersistableObjectHandler:
Collaboration diagram for XoopsPersistableObjectHandler:

Public Member Functions

 __construct (XoopsDatabase $db=null, $table='', $className='', $keyName='', $identifierName='')
 
 XoopsPersistableObjectHandler (XoopsDatabase $db=null, $table='', $className='', $keyName='', $identifierName='')
 
 setHandler ($handler=null, $args=null, $path=null)
 
 loadHandler ($name, $args=null)
 
 __call ($name, $args)
 
 create ($isNew=true)
 
 get ($id=null, $fields=null)
 
 insert (XoopsObject $object, $force=true)
 
 delete (XoopsObject $object, $force=false)
 
 deleteAll (CriteriaElement $criteria=null, $force=true, $asObject=false)
 
 updateAll ($fieldname, $fieldvalue, CriteriaElement $criteria=null, $force=false)
 
getObjects (CriteriaElement $criteria=null, $id_as_key=false, $as_object=true)
 
getAll (CriteriaElement $criteria=null, $fields=null, $asObject=true, $id_as_key=true)
 
 getList (CriteriaElement $criteria=null, $limit=0, $start=0)
 
getIds (CriteriaElement $criteria=null)
 
getByLimit ($limit=0, $start=0, CriteriaElement $criteria=null, $fields=null, $asObject=true)
 
 getCount (CriteriaElement $criteria=null)
 
 getCounts (CriteriaElement $criteria=null)
 
getByLink (CriteriaElement $criteria=null, $fields=null, $asObject=true, $field_link=null, $field_object=null)
 
 getCountByLink (CriteriaElement $criteria=null)
 
 getCountsByLink (CriteriaElement $criteria=null)
 
 updateByLink ($data, CriteriaElement $criteria=null)
 
 deleteByLink (CriteriaElement $criteria=null)
 
 cleanOrphan ($table_link='', $field_link='', $field_object='')
 
 synchronization ()
 
 convertResultSet ($result, $id_as_key=false, $as_object=true)
 
- Public Member Functions inherited from XoopsObjectHandler
 __construct (XoopsDatabase $db)
 
 XoopsObjectHandler ($db)
 
 create ()
 
 get ($id)
 
 insert (XoopsObject $object)
 
 delete (XoopsObject $object)
 

Data Fields

 $handler
 
 $handlers = array('read' => null, 'stats' => null, 'joint' => null, 'write' => null, 'sync' => null)
 
 $table
 
 $keyName
 
 $className
 
 $identifierName
 
 $field_link
 
 $field_object
 
- Data Fields inherited from XoopsObjectHandler
 $db
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( XoopsDatabase  $db = null,
  $table = '',
  $className = '',
  $keyName = '',
  $identifierName = '' 
)

Constructor

Parameters
null | XoopsDatabase$dbdatabase connection
string$tableName of database table
string$classNameName of the XoopsObject class this handler manages
string$keyNameName of the property holding the key
string$identifierNameName of the property holding an identifier name (title, name ...), used on getList()
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ __call()

__call (   $name,
  $args 
)

Magic method for overloading of delegation

To be enabled in XOOPS 3.0 with PHP 5

@access protected

Parameters
string$namemethod name
array$argsarguments
Returns
mixed
Here is the call graph for this function:

◆ cleanOrphan()

cleanOrphan (   $table_link = '',
  $field_link = '',
  $field_object = '' 
)

*#- *#+ Methods of sync handler XoopsObjectSync Clean orphan objects against linked objects

Parameters
string$table_linktable of linked object for JOIN
string$field_linkfield of linked object for JOIN
string$field_objectfield of current object for JOIN
Returns
bool true on success
Here is the call graph for this function:
Here is the caller graph for this function:

◆ convertResultSet()

convertResultSet (   $result,
  $id_as_key = false,
  $as_object = true 
)

*#- #+

Deprecated:
Parameters
$result
bool$id_as_key
bool$as_object
Returns
bool

◆ create()

create (   $isNew = true)

*#+ Methods of native handler XoopsPersistableObjectHandler create a new object

Parameters
bool$isNewFlag the new objects as new
Returns
XoopsObject XoopsObject

Reimplemented in ProfileProfileHandler.

◆ delete()

delete ( XoopsObject  $object,
  $force = false 
)

delete an object from the database

Parameters
XoopsObject$objectXoopsObject reference to the object to delete
bool$force
Returns
bool FALSE if failed.

Reimplemented in ProfileFieldHandler, and ProfileRegstepHandler.

Here is the call graph for this function:

◆ deleteAll()

deleteAll ( CriteriaElement  $criteria = null,
  $force = true,
  $asObject = false 
)

delete all objects matching the conditions

Parameters
CriteriaElement$criteriaCriteriaElement with conditions to meet
bool$forceforce to delete
bool$asObjectdelete in object way: instantiate all objects and delete one by one
Returns
bool
Here is the call graph for this function:

◆ deleteByLink()

deleteByLink ( CriteriaElement  $criteria = null)

Delete objects matching a condition against linked objects

Parameters
CriteriaElement$criteriaCriteriaElement to match
Returns
int count of objects
Here is the call graph for this function:

◆ get()

get (   $id = null,
  $fields = null 
)

Load a XoopsObject object from the database

@access protected

Parameters
mixed$idID
array$fieldsfields to fetch
Returns
XoopsObject XoopsObject

Reimplemented in ProfileProfileHandler.

Here is the call graph for this function:

◆ getAll()

& getAll ( CriteriaElement  $criteria = null,
  $fields = null,
  $asObject = true,
  $id_as_key = true 
)

get all objects matching a condition

Parameters
CriteriaElement$criteriaCriteriaElement to match
array$fieldsvariables to fetch
bool$asObjectflag indicating as object, otherwise as array
bool$id_as_keyuse the ID as key for the array
Returns
array of objects/array XoopsObject
Here is the call graph for this function:

◆ getByLimit()

& getByLimit (   $limit = 0,
  $start = 0,
CriteriaElement  $criteria = null,
  $fields = null,
  $asObject = true 
)

get a limited list of objects matching a condition

CriteriaCompo

Parameters
int$limitMax number of objects to fetch
int$startWhich record to start at
CriteriaElement$criteriaCriteriaElement to match
array$fieldsvariables to fetch
bool$asObjectflag indicating as object, otherwise as array
Returns
array of objects XoopsObject
Here is the call graph for this function:

◆ getByLink()

& getByLink ( CriteriaElement  $criteria = null,
  $fields = null,
  $asObject = true,
  $field_link = null,
  $field_object = null 
)

*#- *#+ Methods of joint handler XoopsObjectJoint get a list of objects matching a condition joint with another related object

Parameters
CriteriaElement$criteriaCriteriaElement to match
array$fieldsvariables to fetch
bool$asObjectflag indicating as object, otherwise as array
string$field_linkfield of linked object for JOIN
string$field_objectfield of current object for JOIN
Returns
array of objects XoopsObject
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCount()

getCount ( CriteriaElement  $criteria = null)

*#- *#+ Methods of stats handler XoopsObjectStats count objects matching a condition

Parameters
CriteriaElement$criteriaCriteriaElement to match
Returns
int count of objects
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCountByLink()

getCountByLink ( CriteriaElement  $criteria = null)

Count of objects matching a condition

Parameters
CriteriaElement$criteriaCriteriaElement to match
Returns
int count of objects
Here is the call graph for this function:

◆ getCounts()

getCounts ( CriteriaElement  $criteria = null)

Get counts of objects matching a condition

Parameters
CriteriaElement$criteriaCriteriaElement to match
Returns
array of counts
Here is the call graph for this function:

◆ getCountsByLink()

getCountsByLink ( CriteriaElement  $criteria = null)

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

Parameters
CriteriaElement$criteriaCriteriaElement to match
Returns
int count of objects
Here is the call graph for this function:

◆ getIds()

& getIds ( CriteriaElement  $criteria = null)

get IDs of objects matching a condition

Parameters
CriteriaElement$criteriaCriteriaElement to match
Returns
array of object IDs
Here is the call graph for this function:

◆ getList()

getList ( CriteriaElement  $criteria = null,
  $limit = 0,
  $start = 0 
)

Retrieve a list of objects data

Parameters
CriteriaElement$criteriaCriteriaElement conditions to be met
int$limitMax number of objects to fetch
int$startWhich record to start at
Returns
array
Here is the call graph for this function:

◆ getObjects()

& getObjects ( CriteriaElement  $criteria = null,
  $id_as_key = false,
  $as_object = true 
)

*#- *#+ Methods of read handler XoopsObjectRead Retrieve objects from the database

Parameters
CriteriaElement$criteriaCriteriaElement conditions to be met
bool$id_as_keyuse the ID as key for the array
bool$as_objectreturn an array of objects
Returns
array

Reimplemented in SystemBlockHandler.

Here is the call graph for this function:

◆ insert()

insert ( XoopsObject  $object,
  $force = true 
)

*#- *#+ Methods of write handler XoopsObjectWrite insert an object into the database

Parameters
XoopsObject$objectXoopsObject reference to object
bool$forceflag to force the query execution despite security settings
Returns
mixed object ID

Reimplemented in ProfileFieldHandler, ProfileProfileHandler, SystemBlockHandler, and ArtObjectHandler.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadHandler()

loadHandler (   $name,
  $args = null 
)

Load predefined handler

@access protected

Parameters
string$namehandler name
mixed$argsargs
Returns
XoopsModelAbstract of handler XoopsModelAbstract

// Following code just kept as placeholder for PHP5 if (!isset(self::$handlers[$name])) { self::$handlers[$name] = XoopsModelFactory::loadHandler($this, $name, $args); } else { self::$handlers[$name]->setHandler($this); self::$handlers[$name]->setVars($args); }

return self::$handlers[$name];

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setHandler()

setHandler (   $handler = null,
  $args = null,
  $path = null 
)

Set custom handler

@access protected

Parameters
null | string$handler
null$args
string$pathpath to class
Here is the call graph for this function:

◆ synchronization()

synchronization ( )

Synchronizing objects

Returns
bool true on success
Here is the call graph for this function:

◆ updateAll()

updateAll (   $fieldname,
  $fieldvalue,
CriteriaElement  $criteria = null,
  $force = false 
)

Change a field for objects with a certain criteria

Parameters
string$fieldnameName of the field
mixed$fieldvalueValue to write
CriteriaElement$criteriaCriteriaElement
bool$forceforce to query
Returns
bool
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateByLink()

updateByLink (   $data,
CriteriaElement  $criteria = null 
)

update objects matching a condition against linked objects

Parameters
array$dataarray of key => value
CriteriaElement$criteriaCriteriaElement to match
Returns
int count of objects

◆ XoopsPersistableObjectHandler()

XoopsPersistableObjectHandler ( XoopsDatabase  $db = null,
  $table = '',
  $className = '',
  $keyName = '',
  $identifierName = '' 
)

PHP 4 style constructor compatibility shim

Parameters
null | XoopsDatabase$dbdatabase connection
string$tableName of database table
string$classNameName of the XoopsObject class this handler manages
string$keyNameName of the property holding the key
string$identifierNameName of the property holding an identifier name (title, name ...), used on getList()
Deprecated:
all callers should be using parent::__construct()
Here is the call graph for this function:

Field Documentation

◆ $className

$className

◆ $field_link

$field_link

◆ $field_object

$field_object

◆ $handler

$handler

holds reference to custom extended object handler

var object

@access private static protected

◆ $handlers

$handlers = array('read' => null, 'stats' => null, 'joint' => null, 'write' => null, 'sync' => null)

holds reference to predefined extended object handlers: read, stats, joint, write, sync

The handlers hold methods for different purposes, which could be all put together inside of current class. However, load codes only if they are necessary, thus they are now split out.

var array of objects

@access private static protected

◆ $identifierName

$identifierName

◆ $keyName

$keyName

◆ $table

$table

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