Reputation: 921
Below is my Customer dataobject
<?php
class Customer extends DataObject {
static $db = array(
'FirstName' => 'Varchar',
'Surname' => 'Varchar',
'Email' => 'Varchar',
'CustomerType' => "Enum('Private,Business','Private')"
);
static $has_one = array(
'Avatar' => 'Image',
);
static $has_many = array(
'HostingContracts' => 'HostingContract'
);
static $summary_fields = array(
'FirstName',
'Surname',
'CustomerType'
);
static $searchable_fields = array(
'FirstName',
'Surname',
'HostingContracts.ContractNumber'
);
}
?>
I need "Customer" to show as "Client" without changing the class name of the object. Does anyone have an idea how to do this?
Upvotes: 0
Views: 741
Reputation: 716
class Customer extends DataObject {
static $singular_name = 'Client';
static $plural_name = 'Clients';
}
Upvotes: 4