Permalink
Browse files

MINOR Allowing to retrieve the whole configuration array in DateField…

…/TimeField/DateetimeField->getConfig()
  • Loading branch information...
1 parent a60f03f commit 168b1ff279b0fa854923ec3047f5525c000c95ea @chillu chillu committed Sep 19, 2011
Showing with 11 additions and 11 deletions.
  1. +4 −4 forms/DateField.php
  2. +3 −3 forms/DatetimeField.php
  3. +4 −4 forms/TimeField.php
View
@@ -471,11 +471,11 @@ function setConfig($name, $val) {
}
/**
- * @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;
}
}
View
@@ -148,11 +148,11 @@ function setConfig($name, $val) {
* 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) {
View
@@ -181,11 +181,11 @@ function setConfig($name, $val) {
}
/**
- * @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;
}
/**

0 comments on commit 168b1ff

Please sign in to comment.