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

Public Member Functions

 deleteByLink ($criteria=null)
 
getByLink ($criteria=null, $fields=null, $asObject=true, $field_link=null, $field_object=null)
 
 getCountByLink ($criteria=null)
 
 getCountsByLink ($criteria=null)
 
 updateByLink ($data, $criteria=null)
 
 validateLinks ()
 
- Public Member Functions inherited from XoopsModelAbstract
 __construct ($args=null, $handler=null)
 
 setHandler ($handler)
 
 setVars ($args)
 
 XoopsObjectAbstract ($args=null, $handler=null)
 

Additional Inherited Members

- Public Attributes inherited from XoopsModelAbstract
 $handler
 

Detailed Description

Object joint handler class.

Author
Taiwen Jiang phppp.nosp@m.@use.nosp@m.rs.so.nosp@m.urce.nosp@m.forge.nosp@m..net

XoopsObjectAbstract Usage of methods provided by XoopsModelJoint:

Step #1: set linked table and adjoint fields through XoopsPersistableObjectHandler: $handler->table_link = $handler->db->prefix("the_linked_table"); // full name of the linked table that is used for the query $handler->field_link = "the_linked_field"; // name of field in linked table that will be used to link the linked table with current table $handler->field_object = "the_object_field"; // name of field in current table that will be used to link the linked table with current table; linked field name will be used if the field name is not set Step #2: fetch data

Definition at line 38 of file joint.php.

Member Function Documentation

XoopsModelJoint::deleteByLink (   $criteria = null)

Delete objects matching a condition against linked objects

Parameters
object$criteriaCriteriaElement to match
Returns
int count of objects

Definition at line 209 of file joint.php.

References $criteria, and $sql.

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

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; deprecated, for backward compat
string$field_objectfield of current object for JOIN; deprecated, for backward compat
Returns
array of objects XoopsObject

Definition at line 67 of file joint.php.

References $criteria, $fields, $limit, $result, $ret, $sql, and $start.

XoopsModelJoint::getCountByLink (   $criteria = null)

Count of objects matching a condition

Parameters
object$criteriaCriteriaElement to match
Returns
int count of objects

Definition at line 131 of file joint.php.

References $criteria, $result, and $sql.

XoopsModelJoint::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 156 of file joint.php.

References $criteria, $result, $ret, and $sql.

XoopsModelJoint::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 185 of file joint.php.

References $criteria, and $sql.

XoopsModelJoint::validateLinks ( )

Validate information for the linkship

private

Definition at line 45 of file joint.php.


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