<?
class Reaction extends dbObject
{
function __construct($ID=false)
{
$this->__setupDatabase('reactions', // database table
array('ID_Reaction' => 'ID', // database field => mapped object property
'ID_Blog' => 'ID_Blog',
'strPoster' => 'Poster',
'strEmail' => 'Email',
'strIp' => 'Ip',
'strReaction' => 'Reaction',
'datReply' => 'ReplyDate'),
'ID_Reaction', // primary table key
$ID); // value of primary key to init with (can be false for new empty object / row)
$this->addRelation('Blog'); // define a many:many relation to Blog through Reaction
}
function display()
{
return("<div><h4>by {$this->Poster} @ {$this->ReplyDate}</h4><div>{$this->Reaction}</div></div>");
}
}
?>
|