<?php
 
 
/**
 
* Class referred to a mysql table like this:
 
*
 
* 
 
 
CREATE TABLE `POSTS` (
 
  `idMessage` int(11) NOT NULL AUTO_INCREMENT,
 
  `subject` varchar(100) NOT NULL,
 
  `message` longtext NOT NULL,
 
  `dateCreated` datetime DEFAULT NULL,
 
  `dateEdited` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
 
  PRIMARY KEY (`idMessage`)
 
) ENGINE=MyISAM DEFAULT CHARSET=utf8
 
 
 
* 
 
*/
 
class Post extends DbMySql_Persister
 
{
 
    public $idMessage;
 
    public $subject;
 
    public $message;
 
    public $dateCreated;
 
    public $dateEdited;
 
    
 
    public function getPrimaryKey()
 
    {
 
        return "idMessage";
 
    }
 
 
    public function getTableName()
 
    {
 
        return "POSTS";
 
    }
 
 
    
 
    public function __toString()
 
    {
 
        return (string) $this->subject;
 
    }
 
 
}
 
 
?>
 
 
 |