silverstripe-framework/Forms/NumericField_Readonly.php

31 lines
396 B
PHP
Raw Normal View History

<?php
namespace SilverStripe\Forms;
/**
* Readonly version of a numeric field.
*/
class NumericField_Readonly extends ReadonlyField
{
/**
* @return static
*/
public function performReadonlyTransformation()
{
return clone $this;
}
/**
* @return string
*/
public function Value()
{
return $this->value ?: '0';
}
public function getValueCast()
{
return 'Decimal';
}
}