projects
/
core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
eb7f956
)
Much simplier and with is_null() sanity check
author
Roland Häder
<roland@mxchange.org>
Fri, 21 Aug 2009 21:55:43 +0000
(21:55 +0000)
committer
Roland Häder
<roland@mxchange.org>
Fri, 21 Aug 2009 21:55:43 +0000
(21:55 +0000)
inc/classes/main/helper/class_BaseHelper.php
patch
|
blob
|
history
diff --git
a/inc/classes/main/helper/class_BaseHelper.php
b/inc/classes/main/helper/class_BaseHelper.php
index da4f6b12b3f0fffe558ac1d0ab99c5c4539b341b..5cd4ea88b0247d3f567f4185d6408e093f064b0c 100644
(file)
--- a/
inc/classes/main/helper/class_BaseHelper.php
+++ b/
inc/classes/main/helper/class_BaseHelper.php
@@
-438,15
+438,17
@@
class BaseHelper extends BaseFrameworkSystem {
*
* @param $fieldName Name of the field we shall fetch
* @return $fieldValue Value from field
*
* @param $fieldName Name of the field we shall fetch
* @return $fieldValue Value from field
+ * @throws NullPointerException Thrown if $valueInstance is null
*/
public function getValueField ($fieldName) {
*/
public function getValueField ($fieldName) {
- // Construct the eval() command
- $eval = sprintf("\$fieldValue = \$this->getValueInstance()->getField('%s');",
- $fieldName
- );
+ // The $valueInstance attribute should not be null!
+ if (is_null($this->getValueInstance())) {
+ // Throws an exception here
+ throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+ } // END - if
// Get the field value
// Get the field value
-
eval($eval
);
+
$fieldValue = $this->getValueInstance()->getField($fieldName
);
// Return it
return $fieldValue;
// Return it
return $fieldValue;