Permalink
Browse files

Added a to_object() method which utilises to_array() (to save code re…

…petition) but returns an object instead of an array
  • Loading branch information...
1 parent 14fce90 commit c94d24178eecb2027585f59e986b48521d84ef55 @ichilton committed Jun 1, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 classes/model.php
View
@@ -1576,6 +1576,18 @@ public function to_array()
return $array;
}
+
+ /**
+ * Allow converting this object to a real object
+ *
+ * @return object
+ */
+ public function to_object()
+ {
+ return (object) $this->to_array();
+ }
+
+
/**
* Allow for getter, setter and unset methods
*

0 comments on commit c94d241

Please sign in to comment.