XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
XoopsPersistableObjectHandler Class Reference
Inheritance diagram for XoopsPersistableObjectHandler:
Inheritance graph

Public Member Functions

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

Public Attributes

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

Detailed Description

Definition at line 1054 of file object.php.

Constructor & Destructor Documentation

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

*#@- Constructor

protected

Parameters
object$dbXoopsDatabase object
string$tablenameName of database table
string$classnameName of Class, this handler is managing
string$keynameName of the property, holding the key
Returns
void

Definition at line 1108 of file object.php.

References $className, XoopsObjectHandler\$db, $identifierName, $keyName, $table, XoopsDatabaseFactory\getDatabaseConnection(), and XoopsObjectHandler\XoopsObjectHandler().

Referenced by XoopsPersistableObjectHandler().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Function Documentation

XoopsPersistableObjectHandler::__call (   $name,
  $args 
)

Magic method for overloading of delegation

To be enabled in XOOPS 3.0 with PHP 5

protected

Parameters
string$namemethod name
array$argsarguments
Returns
mixed

Definition at line 1195 of file object.php.

References $handler, and loadHandler().

Here is the call graph for this function:

XoopsPersistableObjectHandler::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

Definition at line 1537 of file object.php.

References $handler, $ret, and loadHandler().

Referenced by synchronization().

Here is the call graph for this function:

Here is the caller graph for this function:

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

*#@-#@+

Deprecated:

Definition at line 1561 of file object.php.

& XoopsPersistableObjectHandler::create (   $isNew = true)

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

protected

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

Definition at line 1221 of file object.php.

XoopsPersistableObjectHandler::delete ( $object,
  $force = false 
)

delete an object from the database

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

Definition at line 1294 of file object.php.

References $handler, and loadHandler().

Here is the call graph for this function:

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

delete all objects matching the conditions

Parameters
object$criteriaCriteriaElement with conditions to meet
bool$forceforce to delete
bool$asObjectdelete in object way: instantiate all objects and delte one by one
Returns
bool

Definition at line 1308 of file object.php.

References $criteria, $handler, and loadHandler().

Here is the call graph for this function:

XoopsPersistableObjectHandler::deleteByLink (   $criteria = null)

Delete objects matching a condition against linked objects

Parameters
object$criteriaCriteriaElement to match
Returns
int count of objects

Definition at line 1515 of file object.php.

References $criteria, $handler, $ret, and loadHandler().

Here is the call graph for this function:

& XoopsPersistableObjectHandler::get (   $id = null,
  $fields = null 
)

Load a XoopsObject object from the database

protected

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

Definition at line 1238 of file object.php.

References $fields, $keyName, $result, $sql, and XoopsObjectHandler\create().

Here is the call graph for this function:

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

get all objects matching a condition

Parameters
object$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

Definition at line 1360 of file object.php.

References $criteria, $fields, $handler, $ret, and loadHandler().

Here is the call graph for this function:

& XoopsPersistableObjectHandler::getByLimit (   $limit = 0,
  $start = 0,
  $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
object$criteriaCriteriaElement to match
array$fieldsvariables to fetch
bool$asObjectflag indicating as object, otherwise as array
Returns
array of objects XoopsObject

Definition at line 1407 of file object.php.

References $criteria, $fields, $handler, $limit, $ret, $start, and loadHandler().

Here is the call graph for this function:

& XoopsPersistableObjectHandler::getByLink (   $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
object$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

Definition at line 1462 of file object.php.

References $criteria, $fields, $handler, $ret, and loadHandler().

Referenced by ProfileFieldHandler\loadFields().

Here is the call graph for this function:

Here is the caller graph for this function:

XoopsPersistableObjectHandler::getCount (   $criteria = null)

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

Parameters
object$criteriaCriteriaElement to match
Returns
int count of objects

Definition at line 1427 of file object.php.

References $criteria, $handler, and loadHandler().

Referenced by PmMessageHandler\getSavecount().

Here is the call graph for this function:

Here is the caller graph for this function:

XoopsPersistableObjectHandler::getCountByLink (   $criteria = null)

Count of objects matching a condition

Parameters
object$criteriaCriteriaElement to match
Returns
int count of objects

Definition at line 1475 of file object.php.

References $criteria, $handler, $ret, and loadHandler().

Here is the call graph for this function:

XoopsPersistableObjectHandler::getCounts (   $criteria = null)

Get counts of objects matching a condition

Parameters
object$criteriaCriteriaElement to match
Returns
array of conunts

Definition at line 1439 of file object.php.

References $criteria, $handler, and loadHandler().

Here is the call graph for this function:

XoopsPersistableObjectHandler::getCountsByLink (   $criteria = null)

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

Parameters
object$criteriaCriteriaElement to match
Returns
int count of objects

Definition at line 1488 of file object.php.

References $criteria, $handler, $ret, and loadHandler().

Here is the call graph for this function:

& XoopsPersistableObjectHandler::getIds (   $criteria = null)

get IDs of objects matching a condition

Parameters
object$criteriaCriteriaElement to match
Returns
array of object IDs

Definition at line 1388 of file object.php.

References $criteria, $handler, $ret, and loadHandler().

Here is the call graph for this function:

XoopsPersistableObjectHandler::getList (   $criteria = null,
  $limit = 0,
  $start = 0 
)

Retrieve a list of objects data

Parameters
object$criteriaCriteriaElement conditions to be met
int$limitMax number of objects to fetch
int$startWhich record to start at
Returns
array

Definition at line 1375 of file object.php.

References $criteria, $handler, $limit, $ret, $start, and loadHandler().

Here is the call graph for this function:

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

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

Parameters
object$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

Definition at line 1344 of file object.php.

References $criteria, $handler, $ret, and loadHandler().

Here is the call graph for this function:

XoopsPersistableObjectHandler::insert ( $object,
  $force = true 
)

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

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

Definition at line 1281 of file object.php.

References $handler, and loadHandler().

Here is the call graph for this function:

XoopsPersistableObjectHandler::loadHandler (   $name,
  $args = null 
)

Load predefined handler

protected

Parameters
string$namehandler name
mixed$argsargs
Returns
object of handler XoopsObjectAbstract

// 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];

Definition at line 1160 of file object.php.

References $handlers, XoopsModelFactory\loadHandler(), and xoops_load().

Referenced by __call(), cleanOrphan(), delete(), deleteAll(), deleteByLink(), getAll(), getByLimit(), getByLink(), getCount(), getCountByLink(), getCounts(), getCountsByLink(), getIds(), getList(), getObjects(), insert(), updateAll(), and updateByLink().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Set custom handler

protected

Parameters
object$ the handler
mixed$ args
string$pathpath to class
Returns
object of handler

Definition at line 1140 of file object.php.

References $handler, $path, XoopsModelFactory\loadHandler(), and xoops_load().

Here is the call graph for this function:

XoopsPersistableObjectHandler::synchronization ( )

Synchronizing objects

Returns
bool true on success

Definition at line 1549 of file object.php.

References cleanOrphan().

Here is the call graph for this function:

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

Change a field for objects with a certain criteria

Parameters
string$fieldnameName of the field
mixed$fieldvalueValue to write
object$criteriaCriteriaElement
bool$forceforce to query
Returns
bool

Definition at line 1323 of file object.php.

References $criteria, $handler, and loadHandler().

Referenced by PmMessageHandler\setFromdelete(), PmMessageHandler\setFromsave(), PmMessageHandler\setRead(), PmMessageHandler\setTodelete(), and PmMessageHandler\setTosave().

Here is the call graph for this function:

Here is the caller graph for this function:

XoopsPersistableObjectHandler::updateByLink (   $data,
  $criteria = null 
)

upate objects matching a condition against linked objects

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

Definition at line 1502 of file object.php.

References $criteria, $handler, $ret, and loadHandler().

Here is the call graph for this function:

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

Constructor

protected

Definition at line 1126 of file object.php.

References $className, XoopsObjectHandler\$db, $identifierName, $keyName, $table, and __construct().

Here is the call graph for this function:

Member Data Documentation

XoopsPersistableObjectHandler::$className
XoopsPersistableObjectHandler::$handler

holds reference to custom extended object handler

var object

private static protected

Definition at line 1066 of file object.php.

Referenced by __call(), cleanOrphan(), delete(), deleteAll(), deleteByLink(), getAll(), getByLimit(), getByLink(), getCount(), getCountByLink(), getCounts(), getCountsByLink(), getIds(), getList(), getObjects(), insert(), setHandler(), updateAll(), and updateByLink().

XoopsPersistableObjectHandler::$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 splitted out.

var array of objects

private static protected

Definition at line 1081 of file object.php.

Referenced by loadHandler().

XoopsPersistableObjectHandler::$identifierName
XoopsPersistableObjectHandler::$keyName
XoopsPersistableObjectHandler::$table

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