This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Controller_Comment extends Controller{ | |
protected $model_name='Model_Comment'; | |
} |