Revision: 134
http://sourceforge.net/p/beeframework/code/134
Author: m_plomer
Date: 2013-11-26 06:51:53 +0000 (Tue, 26 Nov 2013)
Log Message:
-----------
- Bee_MVC_Model: added hasValue()
Modified Paths:
--------------
trunk/framework/Bee/MVC/Model.php
Modified: trunk/framework/Bee/MVC/Model.php
===================================================================
--- trunk/framework/Bee/MVC/Model.php 2013-11-22 23:34:27 UTC (rev 133)
+++ trunk/framework/Bee/MVC/Model.php 2013-11-26 06:51:53 UTC (rev 134)
@@ -62,6 +62,10 @@
return self::$modelValues[$key];
}
+ public static function hasValue($key) {
+ return array_key_exists($key, self::$modelValues);
+ }
+
public static function getModelValues() {
return self::$modelValues;
}
@@ -74,12 +78,14 @@
*/
class MODEL extends Bee_MVC_Model {
- public static function get($key) {
+ public static function get($key, $defaultValue=null) {
+ if (!is_null($defaultValue) && !Bee_MVC_Model::hasValue($key)) {
+ return $defaultValue;
+ }
return Bee_MVC_Model::getValue($key);
}
public static function getModel() {
return Bee_MVC_Model::getModelValues();
}
-}
-?>
\ No newline at end of file
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|