Simplified implementation of FieldSet::makeReadonlyField()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@69350 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-12-17 04:21:40 +00:00
parent d64297e9ee
commit c0fc790e32

View File

@ -471,6 +471,7 @@ class FieldSet extends DataObjectSet {
* @param string|FormField
*/
function makeFieldReadonly($field) {
$fieldName = ($field instanceof FormField) ? $field->Name() : $field;
$srcField = $this->dataFieldByName($fieldName);
$this->replaceField($fieldName, $srcField->performReadonlyTransformation());
}