summaryrefslogtreecommitdiff
path: root/framework/DataAccess/TActiveRecord.php
diff options
context:
space:
mode:
authorwei <>2006-06-12 03:10:47 +0000
committerwei <>2006-06-12 03:10:47 +0000
commit1c6f1f79d011579a158e87459040075331b636b7 (patch)
tree75236e04a5e2aaf9685b34ed7bed0f82e591bbb4 /framework/DataAccess/TActiveRecord.php
parentf30c38fcc9d6cdfa7aafa5078a58645192c11974 (diff)
Minor updates.
Diffstat (limited to 'framework/DataAccess/TActiveRecord.php')
-rw-r--r--framework/DataAccess/TActiveRecord.php51
1 files changed, 51 insertions, 0 deletions
diff --git a/framework/DataAccess/TActiveRecord.php b/framework/DataAccess/TActiveRecord.php
new file mode 100644
index 00000000..0c33fde3
--- /dev/null
+++ b/framework/DataAccess/TActiveRecord.php
@@ -0,0 +1,51 @@
+<?php
+
+Prado::using('System.3rdParty.adodb.ADOdb_Active_Record');
+
+/**
+ * Adodb's active record implementation is very basic. Example: A table
+ * named "persons"
+ * <code>
+ * CREATE TABLE persons
+ * (
+ * id INTEGER PRIMARY KEY,
+ * first_name TEXT NOT NULL,
+ * last_name TEXT NOT NULL,
+ * favorite_color TEXT NOT NULL
+ * );
+ * </code>
+ * Create a class called <tt>Person</tt>, connect insert some data as follows.
+ * <code>
+ * class Person extends TActiveRecord { }
+ *
+ * $person = new Person();
+ * $person->first_name = 'Andi';
+ * $person->last_name = 'Gutmans';
+ * $person->favorite_color = 'blue';
+ * $person->save(); // this save will perform an INSERT successfully
+ *
+ * $person = new Person();
+ * $person->first_name = 'John';
+ * $person->last_name = 'Lim';
+ * $person->favorite_color = 'lavender';
+ * $person->save(); // this save will perform an INSERT successfully
+ *
+ * // load record where id=2 into a new ADOdb_Active_Record
+ * $person2 = new Person();
+ * $person2->Load('id=2');
+ * var_dump($person2);
+ * </code>
+ *
+ *
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @version $Revision: $ $Date: $
+ * @package System.DataAccess
+ * @since 3.0
+ */
+class TActiveRecord extends ADOdb_Active_Record
+{
+
+}
+
+?> \ No newline at end of file