[WORKING] mosDBTable constructor

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 )