Permalink
Browse files

Fix for editable id columns

Added function 'stored' for easy access to the currently stored data
  • Loading branch information...
1 parent c3419a4 commit a27252b682a41bc9b86c647e20e385f0ce1616aa @tefra committed Aug 12, 2012
Showing with 19 additions and 0 deletions.
  1. +19 −0 data/Entity.php
View
@@ -400,6 +400,25 @@ public function export() {
);
}
+ /**
+ * Easy access to the currently stored values
+ *
+ * @param string $name Optionally included field name.
+ * @return mixed Entire stored data array if $name is empty, otherwise the value from the named field.
+ */
+ public function stored($name = null)
+ {
+ if($this->exists())
+ {
+ if($name)
+ {
+ return isset($this->_data[$name]) ? $this->_data[$name] : null;
+ }
+ return $this->_data;
+ }
+ return false;
+ }
+
/**
* Converts the data in the record set to a different format, i.e. an array.
*

0 comments on commit a27252b

Please sign in to comment.