summaryrefslogtreecommitdiff
path: root/it_dbi.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_dbi.class')
-rw-r--r--it_dbi.class11
1 files changed, 11 insertions, 0 deletions
diff --git a/it_dbi.class b/it_dbi.class
index fbe9690..3281415 100644
--- a/it_dbi.class
+++ b/it_dbi.class
@@ -874,6 +874,17 @@ function valid()
return (bool)$this->_data;
}
+
+/**
+ * STATIC: create an object and read its record from DB.
+ * @param $id ID of record to read
+ * @return initialized object or null if ID not found
+ */
+static function get($id)
+{
+ return isset($id) && ($rec = new static) && $rec->read($id) ? $rec : null;
+}
+
} /* End class it_dbi */
?>