Documentation Menu

1.5 Template Project

The Joomla! Documentation Working Group is running a project to develop detailed reference and tutorial material on Joomla! 1.5 templates.  There is a project page on the documentation wiki where you can see the work in progress and help us by contributing your knowledge.

Who's Online

We have 5 guests online

Help Site License

The Joomla! Help Site content 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.
Home arrow Manual arrow 11. API Reference arrow [WORKING] mosDBTable constructor

[WORKING] mosDBTable constructor PDF Print E-mail

Last reviewed: Not reviewed
phpDocumentor

mosDBTable constructor

This is the constructor for the mosDBTable class.  Can be overloaded/supplemented by the child class.

Syntax

void mosDBTable ( string $table, string $key, object &$db )

$table
is the name of the table in the database schema relating to the child class.
$key
is the name of the primary key field in the table.
$db
is a database connector object (an object of type database).

Examples

Example: This is an example of a class called myTable which is associated with the database table called jos_myTable and contains three fields.  Notice how the constructor calls the parent constructor to set up the database connector object.
/**
 * myTable database table class
 * @package MyComponent
 */
 class myTable extends mosDBTable {
   /** @var int Primary key */
   var $id=null;
   /** @var string */
   var $title=null;
   /** @var string */
   var $published=null;
   /** @var boolean */
 
   /**
   * @param database A database connector object
   */
   function myTable( &$db ) {
     $this->mosDBTable( '#__myTable', 'id', $db );
   }
 
 }

Please report any errors on this page to the Developer Documentation Forum.

Last Updated ( Monday, 25 December 2006 )
 
< Prev   Next >