0

下面是我的客户数据对象

<?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'
);
    }
    ?>

我需要“客户”显示为“客户”而不更改对象的类名。有谁知道如何做到这一点?

4

1 回答 1

4
class Customer extends DataObject {
  static $singular_name = 'Client';
  static $plural_name = 'Clients';
}
于 2012-12-04T09:03:19.160 回答