Public Method Details |
pxdb_collection |
public void pxdb_collection([ mixed $dt ])
|
|
|
Parameter |
|
mixed |
$dt |
= >>null<< |
|
Current datatype(s): Array, list, integer. |
|
Returns |
void |
|
get_sql |
public string get_sql()
|
|
This is useful if you want to you your own DB accessing tools to fetch content or if you want to further filter the SQL produced by a collection. (this allows you to get around issues of needing to combine search-type and filter-type pxdb_search classes.
|
Returns |
string The class SQL statement. |
|
is_authorized |
public boolean is_authorized(integer $record_id, [ string $priv ])
|
|
|
Parameter |
|
integer |
$record_id |
|
|
the ID of the record we are checking. |
|
|
string |
$priv |
= >>'read'<< |
|
The priv we are looking for. |
|
Returns |
boolean |
|
&fetch_record |
public object The &fetch_record([ string $classname ])
|
|
|
Parameter |
|
string |
$classname |
= >>null<< |
|
The name of the class to return as a record. (default is pxdb_record) |
|
Returns |
object The next record in result set. |
|
&find |
public string &find([ mixed $data ])
|
|
If SQL is passed just sets the class var so that calls to find_record() will be able to execute the query.
|
Parameter |
|
mixed |
$data |
= >>null<< |
|
The SQL statement or object search on. |
|
Returns |
string The SQL that will be used in the query. |
|
&execute |
public boolean &execute()
|
|
|
Returns |
boolean Status of query execution |
|
&execute_limit |
public mixed &execute_limit([ integer $limit, integer $offset ])
|
|
Sets the class $rs attribute.
|
Parameter |
|
|
|
|
Returns |
mixed ADOdb result set or false on error. |
|
&raw_execute_page |
public mixed &raw_execute_page(integer $nrows, integer $page)
|
|
|
Parameter |
|
integer |
$nrows |
|
|
The number of rows per page. |
|
|
integer |
$page |
|
|
The page to show. |
|
Returns |
mixed ADOdb result set or false on error. |
|
&execute_page |
public mixed &execute_page(integer $nrows, integer $page)
|
|
using the same query twice.
|
Parameter |
|
integer |
$nrows |
|
|
The number of rows per page. |
|
|
integer |
$page |
|
|
The page to show. |
|
Returns |
mixed ADOdb result set or false on error. |
|
num_records |
public integer num_records()
|
|
Note that if you are doing a paged-query (execute_page()) this will only return the number of records on current page (current recordset). To find the total number of records use the total_num_records() method.
|
Returns |
integer Number of records in current recordset. |
Since |
0.0.2 |
|
total_num_records |
public integer total_num_records()
|
|
Currently ADOdb does not have good support for getting total number of records when using PageExecute().
|
Returns |
integer Total number of records found. |
Since |
0.0.2 |
|
weighted_childtype |
public void weighted_childtype(integer $relid)
|
|
Child datatypes are datatypes that have specified parent relids (a relationship relating child datatype to the parent datatype(s)). It is assumed that if you specify that this result set is a weighted_childtype, that you have also applied a filter restricting the results to the children of one particular record. If you don't restrict your results, then the order/placement of results will be incorrect. EXPERIMENTAL, UNIMPLIMENTED
|
Parameter |
|
integer |
$relid |
|
|
The RELID relating the children |
|
Returns |
void |
|
set_order_strict |
public void set_order_strict(mixed $orderby)
|
|
|
Parameter |
|
mixed |
$orderby |
|
|
ORDER BY string or array of strings |
|
Returns |
void |
|
set_order |
public void set_order(mixed $orderby, [ array $join_cols ])
|
|
Designed to be used if this class is building your whole SQL statement for you. Setting order can actually be a complex task, since any lookups on pickids are performed -- and tables joined (LEFT) if necessary.
|
Parameter |
|
mixed |
$orderby |
|
|
ORDER BY string or array of strings. |
|
|
array |
$join_cols |
= >>null<< |
|
Hash of [field names] => [related col to orderby] |
|
Returns |
void |
|
get_order |
public mixed get_order()
|
|
|
Returns |
mixed , returns false if no order is set |
Author(s) |
|
|
set_show_unapproved |
public boolean set_show_unapproved(boolean $set)
|
|
Warning: documentation is missing.
|
Parameter |
|
|
Returns |
boolean True or false on error |
|
priv_filter_sql |
public string priv_filter_sql(string $sql)
|
|
Works by inserting an INNER JOIN in the FROM clause (actually, before the WHERE clause) of the passed SQL.
|
Parameter |
|
string |
$sql |
|
|
The SQL statement to filter. |
|
Returns |
string $sql The filtered SQL statement. |
|
set_priv_ugids |
public void set_priv_ugids(array $ugids)
|
|
By default, if a logged in user is detected it will use all their groups, otherwise the collection should restrict to the Everyone(0) group
|
Parameter |
|
array |
$ugids |
|
|
string comma-seperated list of user/group ids |
|
Returns |
void |
|
build_sql |
public string build_sql(object [unknown] $search)
|
|
This method builds a complete SQL statement -- including privilege filtering and approval filtering based on values in the passed filter.
|
Parameter |
|
object [unknown] |
$search |
|
|
A pxdb_search object for which to build SQL. |
|
Returns |
string The SQL statement. |
|
findCount |
public void findCount( $search)
|
|
Should really use fetchCount method.
|
Parameter |
|
|
$search |
|
|
Warning: documentation is missing. |
|
Returns |
void |
|
fetchCount |
public integer fetchCount( $search)
|
|
instead of total_num_records
|
Parameter |
|
|
$search |
|
|
Warning: documentation is missing. |
|
Returns |
integer |
|