_a['table'] = 'idf_review_filecomments'; $this->_a['model'] = __CLASS__; $this->_a['cols'] = array( // It is mandatory to have an "id" column. 'id' => array( 'type' => 'Pluf_DB_Field_Sequence', 'blank' => true, ), 'patch' => array( 'type' => 'Pluf_DB_Field_Foreignkey', 'model' => 'IDF_Review_Patch', 'blank' => false, 'verbose' => __('patch'), 'relate_name' => 'filecomments', ), 'cfile' => array( 'type' => 'Pluf_DB_Field_Varchar', 'blank' => false, 'size' => 250, 'help_text' => 'The changed file, for example src/foo/bar.txt, this is the path to access it in the repository.', ), 'content' => array( 'type' => 'Pluf_DB_Field_Text', 'blank' => false, 'verbose' => __('comment'), ), 'submitter' => array( 'type' => 'Pluf_DB_Field_Foreignkey', 'model' => 'Pluf_User', 'blank' => false, 'verbose' => __('submitter'), 'relate_name' => 'commented_patched_files', ), 'creation_dtime' => array( 'type' => 'Pluf_DB_Field_Datetime', 'blank' => true, 'verbose' => __('creation date'), ), ); $this->_a['idx'] = array( 'creation_dtime_idx' => array( 'col' => 'creation_dtime', 'type' => 'normal', ), ); } function _toIndex() { return $this->cfile.' '.$this->content; } function preDelete() { IDF_Timeline::remove($this); } function preSave($create=false) { if ($this->id == '') { $this->creation_dtime = gmdate('Y-m-d H:i:s'); } } function postSave($create=false) { } public function timelineFragment($request) { return ''; } }