summaryrefslogtreecommitdiff
path: root/idiorm.php
diff options
context:
space:
mode:
Diffstat (limited to 'idiorm.php')
-rw-r--r--idiorm.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/idiorm.php b/idiorm.php
index 58de3b9..e4e9ab6 100644
--- a/idiorm.php
+++ b/idiorm.php
@@ -807,6 +807,20 @@
}
/**
+ * Return the raw data wrapped by this ORM
+ * instance as an associative array. Column
+ * names may optionally be supplied as arguments,
+ * if so, only those keys will be returned.
+ */
+ public function as_array() {
+ if (func_num_args() === 0) {
+ return $this->_data;
+ }
+ $args = func_get_args();
+ return array_intersect_key($this->_data, array_flip($args));
+ }
+
+ /**
* Return the value of a property of this object (database row)
* or null if not present.
*/