API - XOOPS 2.5.11 Beta 2
By monxoops.fr
|
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 | |
__construct | ( | XoopsDatabase | $db = null , |
$table = '' , |
|||
$className = '' , |
|||
$keyName = '' , |
|||
$identifierName = '' |
|||
) |
Constructor
null | XoopsDatabase | $db | database connection |
string | $table | Name of database table |
string | $className | Name of the XoopsObject class this handler manages |
string | $keyName | Name of the property holding the key |
string | $identifierName | Name of the property holding an identifier name (title, name ...), used on getList() |
__call | ( | $name, | |
$args | |||
) |
Magic method for overloading of delegation
To be enabled in XOOPS 3.0 with PHP 5
@access protected
string | $name | method name |
array | $args | arguments |
cleanOrphan | ( | $table_link = '' , |
|
$field_link = '' , |
|||
$field_object = '' |
|||
) |
*#- *#+ Methods of sync handler XoopsObjectSync
Clean orphan objects against linked objects
string | $table_link | table of linked object for JOIN |
string | $field_link | field of linked object for JOIN |
string | $field_object | field of current object for JOIN |
convertResultSet | ( | $result, | |
$id_as_key = false , |
|||
$as_object = true |
|||
) |
create | ( | $isNew = true | ) |
*#+ Methods of native handler XoopsPersistableObjectHandler
create a new object
bool | $isNew | Flag the new objects as new |
XoopsObject
Reimplemented in ProfileProfileHandler.
delete | ( | XoopsObject | $object, |
$force = false |
|||
) |
delete an object from the database
XoopsObject | $object | XoopsObject reference to the object to delete |
bool | $force |
Reimplemented in ProfileFieldHandler, and ProfileRegstepHandler.
deleteAll | ( | CriteriaElement | $criteria = null , |
$force = true , |
|||
$asObject = false |
|||
) |
delete all objects matching the conditions
CriteriaElement | $criteria | CriteriaElement with conditions to meet |
bool | $force | force to delete |
bool | $asObject | delete in object way: instantiate all objects and delete one by one |
deleteByLink | ( | CriteriaElement | $criteria = null | ) |
Delete objects matching a condition against linked objects
CriteriaElement | $criteria | CriteriaElement to match |
get | ( | $id = null , |
|
$fields = null |
|||
) |
Load a XoopsObject
object from the database
@access protected
mixed | $id | ID |
array | $fields | fields to fetch |
XoopsObject
Reimplemented in ProfileProfileHandler.
& getAll | ( | CriteriaElement | $criteria = null , |
$fields = null , |
|||
$asObject = true , |
|||
$id_as_key = true |
|||
) |
get all objects matching a condition
CriteriaElement | $criteria | CriteriaElement to match |
array | $fields | variables to fetch |
bool | $asObject | flag indicating as object, otherwise as array |
bool | $id_as_key | use the ID as key for the array |
XoopsObject
& getByLimit | ( | $limit = 0 , |
|
$start = 0 , |
|||
CriteriaElement | $criteria = null , |
||
$fields = null , |
|||
$asObject = true |
|||
) |
get a limited list of objects matching a condition
int | $limit | Max number of objects to fetch |
int | $start | Which record to start at |
CriteriaElement | $criteria | CriteriaElement to match |
array | $fields | variables to fetch |
bool | $asObject | flag indicating as object, otherwise as array |
XoopsObject
& 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
CriteriaElement | $criteria | CriteriaElement to match |
array | $fields | variables to fetch |
bool | $asObject | flag indicating as object, otherwise as array |
string | $field_link | field of linked object for JOIN |
string | $field_object | field of current object for JOIN |
XoopsObject
getCount | ( | CriteriaElement | $criteria = null | ) |
*#- *#+ Methods of stats handler XoopsObjectStats
count objects matching a condition
CriteriaElement | $criteria | CriteriaElement to match |
getCountByLink | ( | CriteriaElement | $criteria = null | ) |
Count of objects matching a condition
CriteriaElement | $criteria | CriteriaElement to match |
getCounts | ( | CriteriaElement | $criteria = null | ) |
Get counts of objects matching a condition
CriteriaElement | $criteria | CriteriaElement to match |
getCountsByLink | ( | CriteriaElement | $criteria = null | ) |
array of count of objects matching a condition of, groupby linked object keyname
CriteriaElement | $criteria | CriteriaElement to match |
& getIds | ( | CriteriaElement | $criteria = null | ) |
get IDs of objects matching a condition
CriteriaElement | $criteria | CriteriaElement to match |
getList | ( | CriteriaElement | $criteria = null , |
$limit = 0 , |
|||
$start = 0 |
|||
) |
Retrieve a list of objects data
CriteriaElement | $criteria | CriteriaElement conditions to be met |
int | $limit | Max number of objects to fetch |
int | $start | Which record to start at |
& getObjects | ( | CriteriaElement | $criteria = null , |
$id_as_key = false , |
|||
$as_object = true |
|||
) |
*#- *#+ Methods of read handler XoopsObjectRead
Retrieve objects from the database
CriteriaElement | $criteria | CriteriaElement conditions to be met |
bool | $id_as_key | use the ID as key for the array |
bool | $as_object | return an array of objects |
Reimplemented in SystemBlockHandler.
insert | ( | XoopsObject | $object, |
$force = true |
|||
) |
*#- *#+ Methods of write handler XoopsObjectWrite
insert an object into the database
XoopsObject | $object | XoopsObject reference to object |
bool | $force | flag to force the query execution despite security settings |
Reimplemented in ProfileFieldHandler, ProfileProfileHandler, SystemBlockHandler, and ArtObjectHandler.
loadHandler | ( | $name, | |
$args = null |
|||
) |
Load predefined handler
@access protected
string | $name | handler name |
mixed | $args | args |
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];
setHandler | ( | $handler = null , |
|
$args = null , |
|||
$path = null |
|||
) |
Set custom handler
@access protected
null | string | $handler | |
null | $args | |
string | $path | path to class |
synchronization | ( | ) |
Synchronizing objects
updateAll | ( | $fieldname, | |
$fieldvalue, | |||
CriteriaElement | $criteria = null , |
||
$force = false |
|||
) |
Change a field for objects with a certain criteria
string | $fieldname | Name of the field |
mixed | $fieldvalue | Value to write |
CriteriaElement | $criteria | CriteriaElement |
bool | $force | force to query |
updateByLink | ( | $data, | |
CriteriaElement | $criteria = null |
||
) |
update objects matching a condition against linked objects
array | $data | array of key => value |
CriteriaElement | $criteria | CriteriaElement to match |
XoopsPersistableObjectHandler | ( | XoopsDatabase | $db = null , |
$table = '' , |
|||
$className = '' , |
|||
$keyName = '' , |
|||
$identifierName = '' |
|||
) |
PHP 4 style constructor compatibility shim
null | XoopsDatabase | $db | database connection |
string | $table | Name of database table |
string | $className | Name of the XoopsObject class this handler manages |
string | $keyName | Name of the property holding the key |
string | $identifierName | Name of the property holding an identifier name (title, name ...), used on getList() |
$className |
$field_link |
$field_object |
$handler |
holds reference to custom extended object handler
var object
@access private static protected
$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 |
$keyName |
$table |