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

Public Member Functions

 validateLinks ()
 
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)
 
- Public Member Functions inherited from XoopsModelAbstract
 __construct ($args=null, $handler=null)
 
 setHandler ($handler)
 
 setVars ($args)
 

Additional Inherited Members

- Data Fields 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

XoopsModelAbstract 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

Member Function Documentation

◆ deleteByLink()

deleteByLink ( CriteriaElement  $criteria = null)

Delete objects matching a condition against linked objects

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

◆ getByLink()

& getByLink ( CriteriaElement  $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
CriteriaElement | CriteriaCompo$criteria
array$fieldsvariables to fetch
bool$asObjectflag indicating as object, otherwise as array
string$field_linkfield of linked object for JOIN; deprecated, for backward compatibility
string$field_objectfield of current object for JOIN; deprecated, for backward compatibility
Returns
array of objects XoopsObject
Here is the call graph for this function:

◆ getCountByLink()

getCountByLink ( CriteriaElement  $criteria = null)

Count of objects matching a condition

Parameters
CriteriaElement | CriteriaCompo$criteriaCriteriaElement to match
Returns
int|false count of objects
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 | CriteriaCompo$criteriaCriteriaElement to match
Returns
int|false|array|null count of objects
Here is the call 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 | CriteriaCompo$criteriaCriteriaElement to match
Returns
int|null count of objects

◆ validateLinks()

validateLinks ( )

Validate information for the link

@access private

Here is the caller graph for this function:

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