summaryrefslogtreecommitdiff
path: root/framework/DataAccess/TActiveRecord.php
blob: e0a4f596549e406b0d561d17eac37261f8c0762a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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 $Id$
 * @package System.DataAccess
 * @since 3.0
 */
class TActiveRecord extends ADOdb_Active_Record
{

}

?>