homejoomlablogministries
articles
guides
tutorials
all
forum

Learning Joomla! for the first time? Buy the Joomla! 1.5 Essential training CD-ROM or watch it on Lynda.com.

 

I am speaking at OpenCamp 2010 in Addison, TX


PDF Print E-mail

 

dailymessage.class.php

 

<?

 

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

 

Yet again, this code should not be called from outside Mambo.

 

class joeDailyMessage extends mosDBTable {

var $id = null;

var $message = null;

var $date = null;

var $published = null;

 

This class extends the mosDBTable class, which provides many useful functions that make it easier to transfer data to and from the database. First, the variables identical to those found in the database table are declared. This way, other pieces of code can create joeDailyMessage objects, load them up with the variables desired, then send them to the database.

 

function joeDailyMessage(&$db){

$this->mosDBTable('mos_joe_dailymessage', 'id', $db);

}

 

}

 

This constructor takes a database object passed by reference and passes it along to the inherited mosDBTable() constructor, along with the table name [#_ shorthand for 'mos'] we wish to reference and name of the field containing the primary key.

 

 

class joeDailyMessageConf extends mosDBTable {

var $bold = null;

var $italic = null;

var $underline = null;

var $showdate = null;

var $configid = null;

 

function joeDailyMessageConf(&$db){

$this->mosDBTable('mos_joe_dailymessage_conf', 'configid', $db);

}

}

 

The joeDailyMessageConf class works in exactly the same way as the joeDailyMessage class, containing the variables found in the mos_joe_dailymessage_conf table and referencing 'configid' as the key.

 

?>