_a['table'] = 'todolists'; /** * The name of the model in the class definition. */ $this->_a['model'] = 'Todo_List'; /** * The definition of the model. Each key of the associative array * corresponds to a "column" and the definition of the column is * given in the corresponding array. */ $this->_a['cols'] = array( // It is mandatory to have an "id" column. 'id' => array( 'type' => 'Pluf_DB_Field_Sequence', //It is automatically added. 'blank' => true, ), 'name' => array( 'type' => 'Pluf_DB_Field_Varchar', 'blank' => false, 'size' => 100, // The verbose name is all lower case 'verbose' => __('name'), ), ); /** * You can define the indexes. * Indexes are you to sort and find elements. Here we define * an index on the completed column to easily select the list * of completed or not completed elements. */ $this->_a['idx'] = array(); $this->_a['views'] = array(); } /** * To nicely render the list in the option boxes. */ function __toString() { return $this->name; } }