Class mosDBTable

Description

mosDBTable Abstract Class.

Parent classes to all database derived objects. Customisation will generally not involve tampering with this object.

  • author: Andrew Eddie <eddieajau@users.sourceforge.net

Located in /includes/database.php (line 559)


	
			
Direct descendents
Class Description
mosConfig
mosNewsFeed
mosPoll
mosTemplatePosition
mosBannerClient
mosBanner
mosContact
mosFrontPage
mosMessage
mosWeblink Category database table class
mosARO mosDBTable Abstract Class.
mosAroGroup Utility function for returning groups
mosComponent Component database table class
mosCategory Category database table class
mosSection Section database table class
mosContent Module database table class
mosMenu Module database table class
mosUser Users Table Class
mosTemplate Template Table Class
mosMambot Class mosMambot
mosModule Module database table class
mosSession Session database table class
Variable Summary
mosDatabase $_db
string $_error
string $_tbl
string $_tbl_key
Method Summary
mosDBTable mosDBTable (string $table, string $key, mixed &$db)
null|string bind (mixed $array, [mixed $ignore = ""], array $hash)
true|false canDelete ([mixed $oid = null], [int $joins = null], string $msg, array 2)
boolean check ()
void checkin ([mixed $oid = null])
void checkout (mixed $who, [mixed $oid = null])
true delete ([mixed $oid = null])
mixed get (string $_property)
string getError ()
void hit ([mixed $oid = null])
any load ([int $oid = null])
void move (mixed $dirn, [mixed $where = ''])
void publish_array ([array $cid = null], [integer $publish = 1], integer $myid)
TRUE save (array $source, string $order_filter)
void set (string $_property, mixed $_value)
null|string store ([boolean $updateNulls = false])
void toXML ([boolean $mapKeysToText = false])
void updateOrder ([string $where = ''])
Variables
mosDatabase $_db = null (line 567)
  • var: Database connector
string $_error = '' (line 565)
  • var: Error message
string $_tbl = '' (line 561)
  • var: Name of the table in the db schema relating to child class
string $_tbl_key = '' (line 563)
  • var: Name of the primary key field in the table
Methods
Constructor mosDBTable (line 576)

Object constructor to set table and key field

Can be overloaded/supplemented by the child class

mosDBTable mosDBTable (string $table, string $key, mixed &$db)
  • string $table: name of the table in the db schema relating to child class
  • string $key: name of the primary key field in the table
bind (line 614)

binds a named array/hash to this object

can be overloaded/supplemented by the child class

  • return: null is operation was satisfactory, otherwise returns an error
null|string bind (mixed $array, [mixed $ignore = ""], array $hash)
  • array $hash: named array
canDelete (line 812)

Generic check for whether dependancies exist for this object in the db schema

can be overloaded/supplemented by the child class

true|false canDelete ([mixed $oid = null], [int $joins = null], string $msg, array 2)
  • string $msg: Error message returned
  • array 2: Optional array to compiles standard joins: format [label=>'Label',name=>'table name',idfield=>'field',joinfield=>'field']
  • int $joins: Optional key index
check (line 647)

generic check method

can be overloaded/supplemented by the child class

  • return: True if the object is ok
boolean check ()

Redefined in descendants as:
checkin (line 901)
void checkin ([mixed $oid = null])
checkout (line 875)
void checkout (mixed $who, [mixed $oid = null])
delete (line 855)

Default delete method

can be overloaded/supplemented by the child class

  • return: if successful otherwise returns and error message
true delete ([mixed $oid = null])

Redefined in descendants as:
get (line 592)

Gets the value of the class variable

  • return: The value of the class var (or null if no var of that name exists)
mixed get (string $_property)
  • string $_property: The name of the class variable
getError (line 584)
  • return: Returns the error message
string getError ()
hit (line 918)
void hit ([mixed $oid = null])
load (line 628)

binds an array/hash to this object

  • return: result from the database operation
any load ([int $oid = null])
  • int $oid: optional argument, if not specifed then the value of current key is used
move (line 675)
void move (mixed $dirn, [mixed $where = ''])
publish_array (line 980)

Generic Publish/Unpublish function

void publish_array ([array $cid = null], [integer $publish = 1], integer $myid)
  • array $cid: An array of id numbers
  • integer $publish: 0 if unpublishing, 1 if publishing
  • integer $myid: The id of the user performnig the operation
save (line 955)

Generic save function

  • return: if completely successful, FALSE if partially or not succesful.
TRUE save (array $source, string $order_filter)
  • array $source: Source array for binding to class vars
  • string $order_filter: Filter for the order updating
set (line 604)

Set the value of the class variable

void set (string $_property, mixed $_value)
  • string $_property: The name of the class variable
  • mixed $_value: The value to assign to the variable
store (line 658)

Inserts a new row if id is zero or updates an existing row in the database table

Can be overloaded/supplemented by the child class

  • return: null if successful otherwise returns and error message
null|string store ([boolean $updateNulls = false])
  • boolean $updateNulls: If false, null object variables are not updated

Redefined in descendants as:
toXML (line 1007)

Export item list to xml

void toXML ([boolean $mapKeysToText = false])
  • boolean $mapKeysToText: Map foreign keys to text values

Redefined in descendants as:
updateOrder (line 738)

Compacts the ordering sequence of the selected records

void updateOrder ([string $where = ''])
  • string $where: Additional where query to limit ordering to a particular subset of records

Documentation generated on Fri, 4 Mar 2005 13:55:57 +1000 by phpDocumentor 1.3.0RC3