summaryrefslogtreecommitdiff
path: root/idiorm.php
diff options
context:
space:
mode:
Diffstat (limited to 'idiorm.php')
-rw-r--r--idiorm.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/idiorm.php b/idiorm.php
index 4e56569..1b9d9bb 100644
--- a/idiorm.php
+++ b/idiorm.php
@@ -1657,9 +1657,20 @@
/**
* Return the value of a property of this object (database row)
* or null if not present.
+ *
+ * If a column-names array is passed, it will return a associative array
+ * with the value of each column or null if it is not present.
*/
public function get($key) {
- return isset($this->_data[$key]) ? $this->_data[$key] : null;
+ if (is_array($key)) {
+ $result = array();
+ foreach($key as $column) {
+ $result[$column] = isset($this->_data[$column]) ? $this->_data[$column] : null;
+ }
+ return $result;
+ } else {
+ return isset($this->_data[$key]) ? $this->_data[$key] : null;
+ }
}
/**