Framework
3.9
|
This class is used to programmatically perform inner join queries across multiple objects. More...
Public Member Functions | |
InnerJoin ($tag="join") | |
Create a new InnerJoin object. More... | |
generateQuery ($constraints="", $countOnly=false) | |
Public Member Functions inherited from AbstractJoin | |
add ($class) | |
Adds a class to the join definition. More... | |
setFilter ($class, $filter) | |
Sets an InclusionFilter or ExclusionFilter on the specified class. More... | |
constrain ($class, $constraint) | |
Sets a query constraint on the given class. More... | |
excludeKeyFromJoin ($class, $key) | |
By default joins are generated following the "most restrictive search" principle. More... | |
xref ($xref, $xrefFieldMaps=null) | |
Adds a cross-reference class to the join definition. More... | |
pseudo ($class, $items, $indexField) | |
Registers a class and indexed array as a pseudo-join item. More... | |
count ($constraints="", $countExpr=true) | |
query ($constraints="", $page=-1, $size=-1) | |
Performs a query against the database returning an array of JoinResult objects. More... | |
iteratedQuery ($constraints="") | |
Performs a query against the database returning an iterator of JoinResult objects. More... | |
indexedQuery ($constraints="", $indexBy="") | |
Performs a query against the database, returning an array of DataItem objects of the specified class, indexed by a particular field. More... | |
groupedQuery ($constraints="", $indexBy="") | |
Performs a query against the database, returning an array of arrays of DataItem objects of the specified class, grouped by a particular field. More... | |
Additional Inherited Members | |
Public Attributes inherited from AbstractJoin | |
$classes = array() | |
The names of the DataItem classes being joined. More... | |
$protos = array() | |
Prototype instances of the DataItem classes being joined. More... | |
$xrefs = array() | |
Cross-reference classes (i.e. classes that are part of the join, but not the result) More... | |
$xrefFieldMaps = array() | |
Cross-reference field map (to support cross-referencing through fields with differing names) More... | |
$aliases = array() | |
Field aliases for output. More... | |
$xrefAliases = array() | |
Cross-reference table aliases. More... | |
$constraints = array() | |
Class-specific constraints add via the constrain() method. More... | |
$unique = false | |
true to output distinct rows only More... | |
$tag = "join" | |
XML tag name. More... | |
$excludedKeys = array() | |
$pseudos = array() | |
Pseudo-join lookup tables. More... | |
This class is used to programmatically perform inner join queries across multiple objects.
The InnerJoin will automatically generate the SQL for the join based on the primary key field names of each object. In order for an object to be successfully joined, it must contain a primary key with the same name as a foreign key in another participating object (or a foreign key that matches another object's primary key).
Results are returned as an array of JoinResult composite objects. The matching row from each object in the join as added as a sub-object of the JoinResult with the field name being the class name of the object.
InnerJoin::generateQuery | ( | $constraints = "" , |
|
$countOnly = false |
|||
) |
Reimplemented from AbstractJoin.
Definition at line 658 of file join.inc.
InnerJoin::InnerJoin | ( | $tag = "join" | ) |
Create a new InnerJoin object.