Skip to content

Instantly share code, notes, and snippets.

CREATE TABLE `comments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`phone` varchar(255) DEFAULT NULL,
`comment` text,
`company_id` int(11) DEFAULT NULL,
`status` int(11) DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=53 DEFAULT CHARSET=utf8
class Model_Comment extends Model_Table{
protected $entity_code='comments';
protected $table_alias='c';
protected function defineFields(){
$this->newField('id')
->datatype('int')
->caption('ID')
->system(true)
;
@mantonuk
mantonuk / gist:800957
Created January 28, 2011 21:12
Controller_Comment.php
class Controller_Comment extends Controller{
protected $model_name='Model_Comment';
}