Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: Joomla-Framework

License

Content on this site is copyright © 2005 - 2008 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5. Some parts of this website may be subject to other licenses.

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
ClassJTableARO Aro table
ClassJTableAROGroup AroGroup table
ClassJTableCategory Category table
ClassJTableComponent Component table
ClassJTableContent Content table
ClassJTableMenu Menu table
ClassJTableMenuTypes Menu Types table
ClassJTableModule Module table
ClassJTablePlugin Plugin table
ClassJTableSection Section table
ClassJTableSession Session table
ClassJTableUser Users table
Variable Summary
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 database &getInstance (type $type, [string $prefix = 'JTable'], [ $config = array()], array $options)
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 = ''], [mixed $ignore = ''])
Method void setDBO ( &$db, object $db)
Method null|string store ([boolean $updateNulls = false])
Method void toXML ([boolean $mapKeysToText = false])
Variables
JDatabase $_db = null (line 54)

Database connector

  • 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

Inherited Variables

Inherited from JObject

Variable JObject::$_errors
Methods
Constructor __construct (line 66)

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 836)

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 191)

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 487)

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 266)

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 618)

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 586)

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 551)

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 127)

Get the internal database object

  • return: JDatabase based object
object A &getDBO ()
getInstance (line 82)

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'], [ $config = array()], array $options)
  • type $type: The table type to instantiate
  • string $prefix: A prefix for the table class name. Optional.
  • array $options: Configuration array for model. Optional.
  • $config
getKeyName (line 160)

Gets the internal primary key name

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

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 149)

Gets the internal table name for the object

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

Description

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

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 226)

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 310)

Description

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

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 425)

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 169)

Resets the default properties

void reset ()
save (line 713)

Generic save function

  • return: if completely successful, FALSE if partially or not succesful.
  • access: public
TRUE save (array $source, [string $order_filter = ''], [mixed $ignore = ''])
  • array $source: Source array for binding to class vars
  • string $order_filter: Filter for the order updating
  • mixed $ignore: An array or space separated list of fields not to bind
setDBO (line 138)

Set the internal database object

void setDBO ( &$db, object $db)
  • object $db: A JDatabase based object
  • &$db
store (line 280)

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 801)

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::getError()
 JObject::getErrors()
 JObject::getProperties()
 JObject::getPublicProperties()
 JObject::set()
 JObject::setError()
 JObject::setProperties()
 JObject::toString()

Documentation generated on Tue, 29 Jan 2008 18:51:45 +0000 by phpDocumentor 1.3.1