XOOPS
2.6.0
|
Public Member Functions | |
__call ($name, $args) | |
cleanOrphan ($table_link= '', $field_link= '', $field_object= '') | |
create ($isNew=true) | |
delete (XoopsObject $object, $force=false) | |
deleteAll (CriteriaElement $criteria, $force=true, $asObject=false) | |
deleteByLink (CriteriaElement $criteria=null) | |
get ($id=null, $fields=null) | |
getAll (CriteriaElement $criteria=null, $fields=null, $asObject=true, $id_as_key=true) | |
getByLink (CriteriaElement $criteria=null, $fields=null, $asObject=true, $field_link=null, $field_object=null) | |
getCount (CriteriaElement $criteria=null) | |
getCountByLink (CriteriaElement $criteria=null) | |
getCounts (CriteriaElement $criteria=null) | |
getCountsByLink (CriteriaElement $criteria=null) | |
getIds (CriteriaElement $criteria=null) | |
getList (CriteriaElement $criteria=null, $limit=0, $start=0) | |
getObjects (CriteriaElement $criteria=null, $id_as_key=false, $as_object=true) | |
insert (XoopsObject $object, $force=true) | |
loadHandler ($name, $args=null) | |
setHandler ($handler=null, $args=null, $path=null) | |
synchronization ($table_link= '', $field_link= '', $field_object= '') | |
updateAll ($fieldname, $fieldvalue, CriteriaElement $criteria, $force=false) | |
updateByLink ($data, CriteriaElement $criteria=null) | |
Public Member Functions inherited from Xoops\Core\Kernel\XoopsObjectHandler | |
create () | |
delete (XoopsObject $object, $force=true) | |
get ($int_id) | |
insert (XoopsObject $object, $force=true) | |
Public Attributes | |
$className | |
$field_link | |
$field_object | |
$identifierName | |
$keyName | |
$keyName_link | |
$table | |
$table_link | |
Public Attributes inherited from Xoops\Core\Kernel\XoopsObjectHandler | |
$db2 | |
Protected Member Functions | |
__construct (Connection $db=null, $table= '', $className= '', $keyName= '', $identifierName= '') | |
Protected Member Functions inherited from Xoops\Core\Kernel\XoopsObjectHandler | |
__construct (Connection $db=null) | |
Protected Attributes | |
$handler | |
Private Attributes | |
$handlers = array('read' => null, 'stats' => null, 'joint' => null, 'write' => null, 'sync' => null) | |
Definition at line 30 of file XoopsPersistableObjectHandler.php.
|
protected |
Constructor
null | Connection | $db | Xoops\Core\Dattabase\Connectionobject@paramstring$tableNameofdatabasetable@paramstring$classNameNameofClass,thishandlerismanaging@paramstring$keyNameNameofthepropertyholdingthekey@paramstring$identifierNameNameofthepropertyholdinganidentifiername(title,name...),usedongetList() |
Definition at line 109 of file XoopsPersistableObjectHandler.php.
References Xoops\Core\Kernel\XoopsPersistableObjectHandler\$className, Xoops\Core\Kernel\XoopsPersistableObjectHandler\$identifierName, Xoops\Core\Kernel\XoopsPersistableObjectHandler\$keyName, and Xoops\Core\Kernel\XoopsPersistableObjectHandler\$table.
Xoops\Core\Kernel\XoopsPersistableObjectHandler::__call | ( | $name, | |
$args | |||
) |
Magic method for overloading of delegation
string | $name | method name |
array | $args | arguments |
Definition at line 191 of file XoopsPersistableObjectHandler.php.
References Xoops\Core\Kernel\XoopsPersistableObjectHandler\$handler, $name, and Xoops\Core\Kernel\XoopsPersistableObjectHandler\loadHandler().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::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 |
Definition at line 578 of file XoopsPersistableObjectHandler.php.
References Xoops\Core\Kernel\XoopsPersistableObjectHandler\$field_link, Xoops\Core\Kernel\XoopsPersistableObjectHandler\$field_object, Xoops\Core\Kernel\XoopsPersistableObjectHandler\$handler, Xoops\Core\Kernel\XoopsPersistableObjectHandler\$table_link, and Xoops\Core\Kernel\XoopsPersistableObjectHandler\loadHandler().
Referenced by Xoops\Core\Kernel\XoopsPersistableObjectHandler\synchronization().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::create | ( | $isNew = true | ) |
*#@+ Methods of native handler XoopsPersistableObjectHandler create a new object
bool | $isNew | Flag the new objects as new |
Definition at line 218 of file XoopsPersistableObjectHandler.php.
Xoops\Core\Kernel\XoopsPersistableObjectHandler::delete | ( | XoopsObject | $object, |
$force = false |
|||
) |
delete an object from the database
XoopsObject | $object | XoopsObject reference to the object to delete |
bool | $force | force delete |
Definition at line 311 of file XoopsPersistableObjectHandler.php.
References Xoops\Core\Kernel\XoopsPersistableObjectHandler\$handler, and Xoops\Core\Kernel\XoopsPersistableObjectHandler\loadHandler().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::deleteAll | ( | CriteriaElement | $criteria, |
$force = true , |
|||
$asObject = false |
|||
) |
delete all objects matching the conditions
CriteriaElement | $criteria | CriteriaElement with conditions to meet |
boolean | $force | force to delete |
boolean | $asObject | delete in object way: instantiate all objects and delete one by one |
Definition at line 328 of file XoopsPersistableObjectHandler.php.
References Xoops\Core\Kernel\XoopsPersistableObjectHandler\$handler, and Xoops\Core\Kernel\XoopsPersistableObjectHandler\loadHandler().
Referenced by XoopsGroupPermHandler\deleteByGroup(), XoopsGroupPermHandler\deleteByModule(), CommentsCommentHandler\deleteByModule(), XoopsOnlineHandler\destroy(), XoopsOnlineHandler\gc(), NotificationsNotificationHandler\unsubscribe(), NotificationsNotificationHandler\unsubscribeByItem(), NotificationsNotificationHandler\unsubscribeByModule(), and NotificationsNotificationHandler\unsubscribeByUser().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::deleteByLink | ( | CriteriaElement | $criteria = null | ) |
Delete objects matching a condition against linked objects
CriteriaElement | null | $criteria | CriteriaElement to match |
Definition at line 553 of file XoopsPersistableObjectHandler.php.
References $criteria, Xoops\Core\Kernel\XoopsPersistableObjectHandler\$handler, and Xoops\Core\Kernel\XoopsPersistableObjectHandler\loadHandler().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::get | ( | $id = null , |
|
$fields = null |
|||
) |
Load a XoopsObject object from the database
mixed | $id | ID |
array | $fields | fields to fetch |
Definition at line 238 of file XoopsPersistableObjectHandler.php.
References $id, Xoops\Core\Kernel\XoopsPersistableObjectHandler\$keyName, $result, and Xoops\Core\Kernel\XoopsObjectHandler\create().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::getAll | ( | CriteriaElement | $criteria = null , |
$fields = null , |
|||
$asObject = true , |
|||
$id_as_key = true |
|||
) |
get all objects matching a condition
CriteriaElement | null | $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 |
Definition at line 392 of file XoopsPersistableObjectHandler.php.
References $criteria, Xoops\Core\Kernel\XoopsPersistableObjectHandler\$handler, and Xoops\Core\Kernel\XoopsPersistableObjectHandler\loadHandler().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::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 | null | $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 |
Definition at line 487 of file XoopsPersistableObjectHandler.php.
References $criteria, Xoops\Core\Kernel\XoopsPersistableObjectHandler\$field_link, Xoops\Core\Kernel\XoopsPersistableObjectHandler\$field_object, Xoops\Core\Kernel\XoopsPersistableObjectHandler\$handler, and Xoops\Core\Kernel\XoopsPersistableObjectHandler\loadHandler().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::getCount | ( | CriteriaElement | $criteria = null | ) |
*#@- *#@+ Methods of stats handler XoopsObjectStats count objects matching a condition
CriteriaElement | null | $criteria | CriteriaElement to match |
Definition at line 447 of file XoopsPersistableObjectHandler.php.
References $criteria, Xoops\Core\Kernel\XoopsPersistableObjectHandler\$handler, and Xoops\Core\Kernel\XoopsPersistableObjectHandler\loadHandler().
Referenced by XoopsGroupPermHandler\checkRight(), CommentsCommentHandler\getCountByItemId(), CommentsCommentHandler\getCountByModuleId(), NotificationsNotificationHandler\isSubscribed(), and XoopsTplfileHandler\templateExists().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::getCountByLink | ( | CriteriaElement | $criteria = null | ) |
Count of objects matching a condition
CriteriaElement | null | $criteria | CriteriaElement to match |
Definition at line 507 of file XoopsPersistableObjectHandler.php.
References $criteria, Xoops\Core\Kernel\XoopsPersistableObjectHandler\$handler, and Xoops\Core\Kernel\XoopsPersistableObjectHandler\loadHandler().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::getCounts | ( | CriteriaElement | $criteria = null | ) |
Get counts of objects matching a condition
CriteriaElement | null | $criteria | CriteriaElement to match |
Definition at line 461 of file XoopsPersistableObjectHandler.php.
References $criteria, Xoops\Core\Kernel\XoopsPersistableObjectHandler\$handler, and Xoops\Core\Kernel\XoopsPersistableObjectHandler\loadHandler().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::getCountsByLink | ( | CriteriaElement | $criteria = null | ) |
array of count of objects matching a condition of, groupby linked object keyname
CriteriaElement | null | $criteria | CriteriaElement to match |
Definition at line 522 of file XoopsPersistableObjectHandler.php.
References $criteria, Xoops\Core\Kernel\XoopsPersistableObjectHandler\$handler, and Xoops\Core\Kernel\XoopsPersistableObjectHandler\loadHandler().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::getIds | ( | CriteriaElement | $criteria = null | ) |
get IDs of objects matching a condition
CriteriaElement | null | $criteria | CriteriaElement to match |
Definition at line 424 of file XoopsPersistableObjectHandler.php.
References $criteria, Xoops\Core\Kernel\XoopsPersistableObjectHandler\$handler, and Xoops\Core\Kernel\XoopsPersistableObjectHandler\loadHandler().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::getList | ( | CriteriaElement | $criteria = null , |
$limit = 0 , |
|||
$start = 0 |
|||
) |
Retrieve a list of objects data
CriteriaElement | null | $criteria | CriteriaElement conditions to be met |
int | $limit | Max number of objects to fetch |
int | $start | Which record to start at |
Definition at line 409 of file XoopsPersistableObjectHandler.php.
References $criteria, Xoops\Core\Kernel\XoopsPersistableObjectHandler\$handler, $limit, $start, and Xoops\Core\Kernel\XoopsPersistableObjectHandler\loadHandler().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::getObjects | ( | CriteriaElement | $criteria = null , |
$id_as_key = false , |
|||
$as_object = true |
|||
) |
*#@- *#@+ Methods of read handler XoopsObjectRead Retrieve objects from the database
CriteriaElement | null | $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 |
Definition at line 374 of file XoopsPersistableObjectHandler.php.
References $criteria, Xoops\Core\Kernel\XoopsPersistableObjectHandler\$handler, and Xoops\Core\Kernel\XoopsPersistableObjectHandler\loadHandler().
Referenced by CommentsCommentHandler\getByItemId(), XoopsGroupPermHandler\getGroupIds(), XoopsGroupPermHandler\getItemIds(), AvatarsAvatarHandler\getListByType(), XoopsTplsetHandler\getNameList(), CommentsCommentHandler\getThread(), and CommentsCommentHandler\getTopComments().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::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 |
Definition at line 296 of file XoopsPersistableObjectHandler.php.
References Xoops\Core\Kernel\XoopsPersistableObjectHandler\$handler, and Xoops\Core\Kernel\XoopsPersistableObjectHandler\loadHandler().
Referenced by XoopsGroupPermHandler\addRight(), NotificationsNotificationHandler\doLoginMaintenance(), NotificationsNotificationHandler\subscribe(), CommentsCommentHandler\updateByField(), and NotificationsNotificationHandler\updateByField().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::loadHandler | ( | $name, | |
$args = null |
|||
) |
Load predefined handler
string | $name | handler name |
mixed | $args | args |
// 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 156 of file XoopsPersistableObjectHandler.php.
References Xoops\Core\Kernel\XoopsPersistableObjectHandler\$handler, Xoops\Core\Kernel\XoopsPersistableObjectHandler\$handlers, $name, and Xoops\Core\Kernel\XoopsModelFactory\getInstance().
Referenced by Xoops\Core\Kernel\XoopsPersistableObjectHandler\__call(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\cleanOrphan(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\delete(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\deleteAll(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\deleteByLink(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\getAll(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\getByLink(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\getCount(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\getCountByLink(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\getCounts(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\getCountsByLink(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\getIds(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\getList(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\getObjects(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\insert(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\updateAll(), and Xoops\Core\Kernel\XoopsPersistableObjectHandler\updateByLink().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::setHandler | ( | $handler = null , |
|
$args = null , |
|||
$path = null |
|||
) |
Set custom handler
string | object | $handler | handler |
array | null | $args | arguments |
string | null | $path | path |
Definition at line 134 of file XoopsPersistableObjectHandler.php.
References Xoops\Core\Kernel\XoopsPersistableObjectHandler\$handler, $path, and Xoops\Core\Kernel\XoopsModelFactory\getInstance().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::synchronization | ( | $table_link = '' , |
|
$field_link = '' , |
|||
$field_object = '' |
|||
) |
Synchronizing objects
Definition at line 591 of file XoopsPersistableObjectHandler.php.
References Xoops\Core\Kernel\XoopsPersistableObjectHandler\$field_link, Xoops\Core\Kernel\XoopsPersistableObjectHandler\$field_object, Xoops\Core\Kernel\XoopsPersistableObjectHandler\$table_link, and Xoops\Core\Kernel\XoopsPersistableObjectHandler\cleanOrphan().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::updateAll | ( | $fieldname, | |
$fieldvalue, | |||
CriteriaElement | $criteria, | ||
$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 |
boolean | $force | force to query |
Definition at line 347 of file XoopsPersistableObjectHandler.php.
References Xoops\Core\Kernel\XoopsPersistableObjectHandler\$handler, and Xoops\Core\Kernel\XoopsPersistableObjectHandler\loadHandler().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::updateByLink | ( | $data, | |
CriteriaElement | $criteria = null |
||
) |
upate objects matching a condition against linked objects
array | $data | array of key => value |
CriteriaElement | null | $criteria | CriteriaElement to match |
Definition at line 538 of file XoopsPersistableObjectHandler.php.
References $criteria, Xoops\Core\Kernel\XoopsPersistableObjectHandler\$handler, and Xoops\Core\Kernel\XoopsPersistableObjectHandler\loadHandler().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::$className |
Definition at line 72 of file XoopsPersistableObjectHandler.php.
Referenced by XoopsPersistableObjectHandler\__construct(), ArtObjectHandler\__construct(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\__construct(), and ArtObjectHandler\ArtObjectHandler().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::$field_link |
Xoops\Core\Kernel\XoopsPersistableObjectHandler::$field_object |
|
protected |
holds reference to custom extended object handler
var object
private static protected
Definition at line 42 of file XoopsPersistableObjectHandler.php.
Referenced by Xoops\Core\Kernel\XoopsPersistableObjectHandler\__call(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\cleanOrphan(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\delete(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\deleteAll(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\deleteByLink(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\getAll(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\getByLink(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\getCount(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\getCountByLink(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\getCounts(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\getCountsByLink(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\getIds(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\getList(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\getObjects(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\insert(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\loadHandler(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\setHandler(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\updateAll(), and Xoops\Core\Kernel\XoopsPersistableObjectHandler\updateByLink().
|
private |
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
Definition at line 54 of file XoopsPersistableObjectHandler.php.
Referenced by Xoops\Core\Kernel\XoopsPersistableObjectHandler\loadHandler().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::$identifierName |
Definition at line 82 of file XoopsPersistableObjectHandler.php.
Referenced by XoopsPersistableObjectHandler\__construct(), ArtObjectHandler\__construct(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\__construct(), and ArtObjectHandler\ArtObjectHandler().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::$keyName |
Definition at line 67 of file XoopsPersistableObjectHandler.php.
Referenced by XoopsPersistableObjectHandler\__construct(), ArtObjectHandler\__construct(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\__construct(), ArtObjectHandler\ArtObjectHandler(), and Xoops\Core\Kernel\XoopsPersistableObjectHandler\get().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::$keyName_link |
Definition at line 97 of file XoopsPersistableObjectHandler.php.
Xoops\Core\Kernel\XoopsPersistableObjectHandler::$table |
Definition at line 62 of file XoopsPersistableObjectHandler.php.
Referenced by XoopsPersistableObjectHandler\__construct(), ArtObjectHandler\__construct(), Xoops\Core\Kernel\XoopsPersistableObjectHandler\__construct(), and ArtObjectHandler\ArtObjectHandler().
Xoops\Core\Kernel\XoopsPersistableObjectHandler::$table_link |
Definition at line 77 of file XoopsPersistableObjectHandler.php.
Referenced by Xoops\Core\Kernel\XoopsPersistableObjectHandler\cleanOrphan(), and Xoops\Core\Kernel\XoopsPersistableObjectHandler\synchronization().