Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: Joomla-Framework

Developer Network License

The Joomla! Developer Network content is © copyright 2006 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5

Abstract Class JTable

Description

Abstract Table class

Parent classes to all tables.

Located in /joomla/database/table.php (line 30)

Class JObject   (Subpackage Base)

Abstract class JTable   (Subpackage Table)
Direct descendents
Class Description
ClassJTableContent Content table
ClassJTableSection Section table
ClassJTableUser Users table
ClassJTableMenu Menu table
ClassJTableSession Session table
ClassJTableComponent Component table
ClassJTableMenuTypes Menu Types table
ClassJTableCategory Category table
ClassJTableModule Module table
ClassJTablePlugin Plugin table
ClassJTableARO
ClassJTableAroGroup
Variable Summary
Variable string $_error
Variable string $_tbl
Variable string $_tbl_key
Method Summary
Static method static boolean isCheckedOut ([integer $with = 0], [integer $against = null])
Constructor JTable __construct (string $table, string $key,  &$db, object $db)
Method array addIncludePath ([string $path = null])
Method boolean bind ($from $from, [$ignore $ignore = array()])
Method true|false canDelete ([ $oid = null], [int $joins = null], string $msg, array 2)
Method boolean check ()
Method boolean checkin ([mixed $oid = null])
Method boolean checkout (integer $who, [mixed $oid = null])
Method true delete ([ $oid = null])
Method object A &getDBO ()
Method string getError ()
Method int getErrorNum ()
Method database &getInstance (type $type, [string $prefix = 'JTable'])
Method string getKeyName ()
Method void getNextOrder ([string $where = ''])
Method string getTableName ()
Method void hit ([$oid $oid = null], [$log $log = false])
Method boolean load ([mixed $oid = null])
Method void move ($dirn $dirn, [$where $where = ''])
Method void publish ([array $cid = null], [integer $publish = 1], [integer $user_id = 0])
Method void reorder ([string $where = ''])
Method void reset ()
Method TRUE save (array $source, [string $order_filter = ''])
Method void setDBO ( &$db, object $db)
Method void setError (string $value)
Method void setErrorNum (int $value)
Method null|string store ([boolean $updateNulls = false])
Method void toXML ([boolean $mapKeysToText = false])
Variables
JDatabase $_db = null (line 70)

Database connector

  • access: protected
string $_error = '' (line 54)

Error message

  • access: protected
int $_errorNum = 0 (line 62)

Error number

  • access: protected
string $_tbl = '' (line 38)

Name of the table in the db schema relating to child class

  • access: protected
string $_tbl_key = '' (line 46)

Name of the primary key field in the table

  • access: protected
Methods
Constructor __construct (line 82)

Object constructor to set table and key field

Can be overloaded/supplemented by the child class

  • access: protected
JTable __construct (string $table, string $key,  &$db, object $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
  • object $db: JDatabase object
  • &$db

Redefinition of:
JObject::__construct()
Class constructor, overridden in descendant classes.

Redefined in descendants as:
addIncludePath (line 923)

Add a directory where JTable should search for table types. You may either pass a string or an array of directories.

  • return: An array with directory elements
  • since: 1.5
  • access: public
array addIncludePath ([string $path = null])
  • string $path: A path to search.
bind (line 219)

Binds a named array/hash to this object

Can be overloaded/supplemented by the child class

  • access: public
boolean bind ($from $from, [$ignore $ignore = array()])
  • $from $from: mixed An associative array or object
  • $ignore $ignore: mixed An array or space separated list of fields not to bind

Redefined in descendants as:
canDelete (line 563)

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

can be overloaded/supplemented by the child class

  • access: public
true|false canDelete ([ $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
  • $oid
check (line 295)

Generic check method

Can be overloaded/supplemented by the child class

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

Redefined in descendants as:
checkin (line 694)

Checks in a row

  • return: True if successful, or if checkout is not supported
  • access: public
boolean checkin ([mixed $oid = null])
  • mixed $oid: The primary key value for the row
checkout (line 664)

Checks out a row

  • return: True if successful, or if checkout is not supported
  • access: public
boolean checkout (integer $who, [mixed $oid = null])
  • integer $who: The id of the user
  • mixed $oid: The primary key value for the row
delete (line 627)

Default delete method

can be overloaded/supplemented by the child class

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

Redefined in descendants as:
getDBO (line 135)

Get the internal database object

  • return: JDatabase based object
object A &getDBO ()
getError (line 179)

Returns the error message

string getError ()
getErrorNum (line 189)

Returns the error number

  • return: The error number
int getErrorNum ()
getInstance (line 97)

Returns a reference to the a Table object, always creating it

  • return: A database object
  • since: 1.5
database &getInstance (type $type, [string $prefix = 'JTable'])
  • type $type: The table type to instantiate
  • string $prefix: A prefix for the table class name
getKeyName (line 168)

Gets the internal primary key name

  • since: 1.5
string getKeyName ()
getNextOrder (line 420)

Returns the ordering value to place a new item last in its group

  • access: public
void getNextOrder ([string $where = ''])
  • string $where: query WHERE clause for selecting MAX(ordering).
getTableName (line 157)

Gets the internal table name for the object

  • since: 1.5
string getTableName ()
hit (line 727)

Description

  • access: public
void hit ([$oid $oid = null], [$log $log = false])
  • $oid $oid
  • $log $log
isCheckedOut (line 756)

Check if an item is checked out

This function can be used as a static function too, when you do so you need to also provide the a value for the $against parameter.

  • access: public
boolean isCheckedOut (integer $with, [integer $against = null])
  • integer $with: The userid to preform the match with, if an item is checked out by this user the function will return false
  • integer $against: The userid to perform the match against when the function is used as a static function.
load (line 255)

Loads a row from the database and binds the fields to the object properties

  • return: True if successful
  • access: public
boolean load ([mixed $oid = null])
  • mixed $oid: Optional primary key. If not specifed, the value of current key is used
move (line 340)

Description

  • access: public
void move ($dirn $dirn, [$where $where = ''])
  • $dirn $dirn
  • $where $where
publish (line 838)

Generic Publish/Unpublish function

  • since: 1.0.4
  • access: public
void publish ([array $cid = null], [integer $publish = 1], integer $user_id)
  • array $cid: An array of id numbers
  • integer $publish: 0 if unpublishing, 1 if publishing
  • integer $user_id: The id of the user performnig the operation
reorder (line 451)

Compacts the ordering sequence of the selected records

  • access: public
void reorder ([string $where = ''])
  • string $where: Additional where query to limit ordering to a particular subset of records
reset (line 198)

Resets the default properties

void reset ()
save (line 781)

Generic save function

  • return: if completely successful, FALSE if partially or not succesful.
  • access: public
TRUE save (array $source, [string $order_filter = ''])
  • array $source: Source array for binding to class vars
  • string $order_filter: Filter for the order updating
setDBO (line 146)

Set the internal database object

void setDBO ( &$db, object $db)
  • object $db: A JDatabase based object
  • &$db
setError (line 814)

Sets the internal error message

  • since: 1.5
void setError (string $value)
  • string $value: The error message
setErrorNum (line 824)

Sets the internal error number

void setErrorNum (int $value)
  • int $value: Set the error number with this value
store (line 309)

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
  • access: public
null|string store ([boolean $updateNulls = false])
  • boolean $updateNulls: If false, null object variables are not updated

Redefined in descendants as:
toXML (line 888)

Export item list to xml

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

Redefined in descendants as:

Inherited Methods

Inherited From JObject

 JObject::JObject()
 JObject::__construct()
 JObject::get()
 JObject::getPublicProperties()
 JObject::set()
 JObject::toString()

Documentation generated on Mon, 05 Mar 2007 21:27:40 +0000 by phpDocumentor 1.3.1