APICHANGE: add documentation to changeset r74858.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@74901 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Normann Lou 2009-04-21 22:25:09 +00:00 committed by Sam Minnee
parent 859bbb2eaa
commit 3861c33bc1
9 changed files with 38 additions and 1 deletions

View File

@ -2672,6 +2672,8 @@ class DataObject extends ViewableData implements DataObjectInterface,i18nEntityP
*
* @uses $field_labels
* @uses FormField::name_to_label()
*
* @param boolean $includerelations a boolean value to indicate if the labels returned include relation fields
*
* @return array of all element labels if no argument given
* @return string of label if field

View File

@ -132,6 +132,11 @@ class ErrorPage extends Page {
return $this->extension_instances['Versioned']->publish($fromStage, $toStage, $createNewVersion);
}
/**
*
* @param boolean $includerelations a boolean value to indicate if the labels returned include relation fields
*
*/
function fieldLabels($includerelations = true) {
$labels = parent::fieldLabels($includerelations);
$labels['ErrorCode'] = _t('ErrorPage.CODE', "Error code");

View File

@ -1292,6 +1292,11 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
return $fields;
}
/**
*
* @param boolean $includerelations a boolean value to indicate if the labels returned include relation fields
*
*/
function fieldLabels($includerelations = true) {
$labels = parent::fieldLabels($includerelations);

View File

@ -206,8 +206,8 @@ abstract class BulkLoader extends ViewableData {
$spec = array();
// get database columns (fieldlabels include fieldname as a key)
// using $$includerelations flag as false, so that it only contain $db fields
$spec['fields'] = (array)singleton($this->objectClass)->fieldLabels($includerelations=false);
// Debug::show($spec);die;
$has_ones = singleton($this->objectClass)->has_one();
$has_manys = singleton($this->objectClass)->has_many();

View File

@ -596,6 +596,11 @@ class File extends DataObject {
self::$cache_file_fields = null;
}
/**
*
* @param boolean $includerelations a boolean value to indicate if the labels returned include relation fields
*
*/
function fieldLabels($includerelations = true) {
$labels = parent::fieldLabels($includerelations);
$labels['Name'] = _t('File.Name', 'Name');

View File

@ -111,6 +111,11 @@ class Group extends DataObject {
return $fields;
}
/**
*
* @param boolean $includerelations a boolean value to indicate if the labels returned include relation fields
*
*/
function fieldLabels($includerelations = true) {
$labels = parent::fieldLabels($includerelations);
$labels['Title'] = _t('SecurityAdmin.GROUPNAME', 'Group name');

View File

@ -33,6 +33,11 @@ class LoginAttempt extends DataObject {
static $belongs_many_many = array();
/**
*
* @param boolean $includerelations a boolean value to indicate if the labels returned include relation fields
*
*/
function fieldLabels($includerelations = true) {
$labels = parent::fieldLabels($includerelations);
$labels['Email'] = _t('LoginAttempt.Email', 'Email Address');

View File

@ -865,6 +865,11 @@ class Member extends DataObject {
return $fields;
}
/**
*
* @param boolean $includerelations a boolean value to indicate if the labels returned include relation fields
*
*/
function fieldLabels($includerelations = true) {
$labels = parent::fieldLabels($includerelations);

View File

@ -219,6 +219,11 @@ class i18nTest_DataObject extends DataObject implements TestOnly {
'ManyManyRelation' => 'Member'
);
/**
*
* @param boolean $includerelations a boolean value to indicate if the labels returned include relation fields
*
*/
function fieldLabels($includerelations = true) {
$labels = parent::fieldLabels($includerelations);
$labels['MyProperty'] = _t('i18nTest_DataObject.MyProperty', 'My Property');