mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Allowing to retrieve the whole configuration array in DateField/TimeField/DateetimeField->getConfig()
This commit is contained in:
parent
a60f03f28e
commit
168b1ff279
@ -471,11 +471,11 @@ JS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param String $name
|
||||
* @return mixed
|
||||
* @param String $name Optional, returns the whole configuration array if empty
|
||||
* @return mixed|array
|
||||
*/
|
||||
function getConfig($name) {
|
||||
return $this->config[$name];
|
||||
function getConfig($name = null) {
|
||||
return $name ? $this->config[$name] : $this->config;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -148,11 +148,11 @@ class DatetimeField extends FormField {
|
||||
* Note: Use {@link getDateField()} and {@link getTimeField()}
|
||||
* to get field-specific config options.
|
||||
*
|
||||
* @param String $name
|
||||
* @param String $name Optional, returns the whole configuration array if empty
|
||||
* @return mixed
|
||||
*/
|
||||
function getConfig($name) {
|
||||
return $this->config[$name];
|
||||
function getConfig($name = null) {
|
||||
return $name ? $this->config[$name] : $this->config;
|
||||
}
|
||||
|
||||
function validate($validator) {
|
||||
|
@ -181,11 +181,11 @@ class TimeField extends TextField {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param String $name
|
||||
* @return mixed
|
||||
* @param String $name Optional, returns the whole configuration array if empty
|
||||
* @return mixed|array
|
||||
*/
|
||||
function getConfig($name) {
|
||||
return $this->config[$name];
|
||||
function getConfig($name = null) {
|
||||
return $name ? $this->config[$name] : $this->config;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user