Following code is working on Craft 2:
class My_TableRecord extends BaseRecord {
public function getTableName() {
return 'my_table';
}
protected function defineAttributes() {
return [
'title' => AttributeType::String,
'description' => AttributeType::Mixed
];
}
}
According to this documentation the defineAttributes() is not available in Craft 3. So how can I define table's attributes in Craft3 to complete following code:
class My_TableRecord extends ActiveRecord
{ public static function tableName()
{
return '{{%my_table}}';
}
//equivalent function of defineAttributes() of Craft3 will go here
}