Packageindex Classtrees Modulegroups Elementlist Report XML Files

pxdb.content.output

pxdb_record

pxdb_data
   |
  +-- pxdb_record

public class pxdb_record extends pxdb_data

This class simplifieds retrieval of Syntax content by automatically looking up pickid fields and by returning arrays of record objects for get_field() requests for relationship fields.

AuthorsHans Lellelid <hans@velum.net>
Version$Revision: 1.10 $

 
Direct known subclasses: pxdb_user

Methods inherited from pxdb_data

pxdb_data, get_datatype, get_datatype_list, get_datatype_array, set_datatype, bind_tpl, bind_auth, lookup_colname, lookup_tfid, get_column_identifiers, get_identifiers, set_user_minimal_columns, sql_minimal_columns, sql_aliased_columns

Public Method Summary

void pxdb_record([ mixed $data ])
Constructor.
integer get_id()
Get record id.
void set_id(integer $id)
Set record id.
boolean read()
Reads data from db into class.
array &get_related(mixed $relid, [ mixed $dt, string $orderby, boolean $multiple ])
Gets related records.
void set_show_unapproved(boolean $bool)
Set show_unapproved explicitlyWarning: documentation is missing.
array get_related_values(string $field, integer $relid, [ mixed $dt, string $orderby, boolean $multiple ])
Builds an array of values from [primaryrel] related records.
array &get_secondaryrel_related([ mixed $dt, string $orderby ])
Gets secondaryrel related records.
array get_secondaryrel_related_values(string $field, [ mixed $dt, string $orderby ])
Builds a list of values from [secondaryrel] related records.
array &get_children_noderelid([ constant $noderel_id, string $orderby ])
Gets children [noderel] records by noderelid.
array &get_children([ mixed $dt, string $orderby ])
Gets children [noderel] records.
array get_children_values(string $field, [ mixed $dt, string $orderby ])
Builds an array of values from [noderel children] related records.
array get_parents_values(string $field, [ mixed $dt, string $orderby ])
Builds an array of values from [noderel parents] related records.
mixed get_field_strict(string $field)
The strict version of get_field()--performs no lookups.
mixed &get_field(string $field, [ string $option ])
Smart lookup function for getting field values.
boolean has_field(string $field)
Checks if a record has a specific field
array get_all_privs()
Gets all privs for current row.
array get_user_privs()
Gets privileges for specified user.
Array get_group_privs()
Gets privileges for specified group.
array get_global_privs()
Gets privileges for ugid 0.
boolean is_authorized()
Checks to see if bound pxdb_user can read specified record.

Private Method Summary

array &get_parents([ mixed $dt, mixed $orderby ])
Gets parent [noderel] records.

Fields inherited from pxdb_data

$debug, $errors, $datatype, $auth, $tpl, $show_unapproved, $db, $user_minimal_columns

Public Field Summary

array $fields

integer $record_id

Public Method Details

pxdb_record

public void pxdb_record([ mixed $data ])

  Can be passed an id or a recordset row (array) -- to eliminate the need for unnecessary db queries.

Parameter
mixed $data = >>null<<
The id of record to look up or row of table.
Returns void


get_id

public integer get_id()

 

Returns integer


set_id

public void set_id(integer $id)

 

Parameter
integer $id
Returns void


read

public boolean read()

 

Returns boolean

on success or reading record.


&get_related

public array &get_related(mixed $relid, [ mixed $dt, string $orderby, boolean $multiple ])

 

Parameter
mixed $relid
Relid or array of relids.
mixed $dt = >>null<<
Datatype or array of datatypes.
string $orderby = >>'name'<<
ORDER BY
boolean $multiple = >>false<<
Returns array

Array of pxdb_record objects (returned by reference).


set_show_unapproved

public void set_show_unapproved(boolean $bool)

 

Warning: documentation is missing.

Parameter
boolean $bool
Returns void


get_related_values

public array get_related_values(string $field, integer $relid, [ mixed $dt, string $orderby, boolean $multiple ])

  This is for convenience.

Parameter
string $field
The field to lookup.
integer $relid
mixed $dt = >>null<<
Datatype or array of datatypes
string $orderby = >>'name'<<
ORDER BY
boolean $multiple = >>false<<
Returns array

Array of $field value for related records.


&get_secondaryrel_related

public array &get_secondaryrel_related([ mixed $dt, string $orderby ])

 

Parameter
mixed $dt = >>null<<
Datatype or array of datatypes.
string $orderby = >>'name'<<
ORDER BY
Returns array

Array of pxdb_record objects.


get_secondaryrel_related_values

public array get_secondaryrel_related_values(string $field, [ mixed $dt, string $orderby ])

  This is for convenience.

Parameter
string $field
The field to lookup.
mixed $dt = >>null<<
Datatype or array of datatypes.
string $orderby = >>'name'<<
ORDER BY
Returns array

Array of $field value for related records.


&get_children_noderelid

public array &get_children_noderelid([ constant $noderel_id, string $orderby ])

 

Parameter
constant $noderel_id = >>NODEREL_SECTION_TO_SECTION,<<
Noderel ID of children to get
string $orderby = >>'name'<<
Field to order results by
Returns array

Array of pxdb_record objects.


&get_children

public array &get_children([ mixed $dt, string $orderby ])

 

Parameter
mixed $dt = >>null<<
Datatype or array of datatypes.
string $orderby = >>'name'<<
Field to order results by
Returns array

Array of pxdb_record objects.


get_children_values

public array get_children_values(string $field, [ mixed $dt, string $orderby ])

  This is for convenience.

Parameter
string $field
The field to lookup.
mixed $dt = >>null<<
Datatype or array of datatypes.
string $orderby = >>'name'<<
ORDER BY
Returns array

Array of $field value for related records.


get_parents_values

public array get_parents_values(string $field, [ mixed $dt, string $orderby ])

  This is for convenience.

Parameter
string $field
The field to lookup.
mixed $dt = >>null<<
Datatype or array of datatypes.
string $orderby = >>'name'<<
ORDER BY
Returns array

Array of $field value for related records.


get_field_strict

public mixed get_field_strict(string $field)

  Use this function, e.g., if you want to make sure that you get an ID returned when getting the value for a pickid column.

Parameter
string $field
The fieldname for which to get value.
Returns mixed

False on error (e.g. field doesn't exist) otherwise value.


&get_field

public mixed &get_field(string $field, [ string $option ])

 

Parameter
string $field
The column name (dbfield) or typesfields displayname of field to fetch.
string $option = >>null<<
If pick, field name to return or 'get_pickids' to ensure ids are returned. If relationship, field name to return.
Returns mixed

False on error, otherwise value.


has_field

public boolean has_field(string $field)

 

Parameter
string $field
name
Returns boolean


get_all_privs

public array get_all_privs()

 

Returns array

Array of Hash name=> ugid=> priv=>


get_user_privs

public array get_user_privs()

 

Returns array

Hash name=>user name, ugid => user id, priv => user privs.


get_group_privs

public Array get_group_privs()

 

Returns Array

Hash name=>group name, ugid => group id, priv => group privs.'


get_global_privs

public array get_global_privs()

 

Returns array

Hash name=>'Everyone', ugid => '0', priv => global privs.


is_authorized

public boolean is_authorized()

 

Returns boolean


Private Method Details

&get_parents

private array &get_parents([ mixed $dt, mixed $orderby ])

 

Parameter
mixed $dt = >>null<<
Relid or array of relids.
mixed $orderby = >>'name'<<
Datatype or array of datatypes.
Returns array

Array of pxdb_record objects.


Public Field Details

$fields

public array $fields

>><<


$record_id

public integer $record_id

>><<



Packageindex Classtrees Modulegroups Elementlist Report XML Files
Generated on Fri, 28 Apr 2006 19:07:22 -0400 by PHPDoc v1.5 www.phpdoc.de