Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Changing datatype IDs to titles in ModelAdmin


2 Posts   297 Views


Community Member, 146 Posts

18 July 2013 at 3:52am


Please see attached, I have a model VehicleType

class VehicleType extends DataObject
static $db = array (
'VehicleTypeName' => 'Varchar(255)',
'VehicleRegRequired' => 'Boolean'

static $has_one = array(

static $has_many = array(
'Tariffs' => 'Tariff'

static $searchable_fields = array(

static $summary_fields = array(


When I create a new Vehicle type in admin it says "Saved #1". I want to to say "Saved "Car"" instead. Is this possible?


Attached Files

Community Member, 175 Posts

18 July 2013 at 4:05am

Edited: 18/07/2013 4:05am

You should be able to do it like this:

public function getTitle() {
   return $this->VehicleTypeName;