Last change
on this file since 186 was
186,
checked in by jkraaijeveld, 13 years ago
|
Implemented lazy evaluation.
- Initially, references to other database objects are now given as an ID rather than an object.
- Every model class now has an evaluate() function, which gets all the objects that object has references to. Returns true if it got all the values correctly, false if there are invalid references.
- Every connector now first evaluates an object before storing, to make sure only objects with valid references get stored.
|
File size:
709 bytes
|
Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | /** |
---|
4 | * Description of Respondent |
---|
5 | * |
---|
6 | * @author jkraaijeveld |
---|
7 | */ |
---|
8 | class Respondent { |
---|
9 | public $name; |
---|
10 | public $password; |
---|
11 | |
---|
12 | /** |
---|
13 | * Constructor for a Respondent object |
---|
14 | * @param type $uid |
---|
15 | * @param type $name |
---|
16 | * @param type $password |
---|
17 | */ |
---|
18 | public function __construct($uid = null, $name = null, $password = null) { |
---|
19 | if(!isset($uid)) |
---|
20 | { |
---|
21 | $uid = md5(uniqid(rand(), true)); |
---|
22 | } |
---|
23 | |
---|
24 | $this->uid = $uid; |
---|
25 | $this->name = $name; |
---|
26 | $this->password = $password; |
---|
27 | } |
---|
28 | |
---|
29 | /* |
---|
30 | * function evaluate() |
---|
31 | * evaluates all the references. |
---|
32 | */ |
---|
33 | public function evaluate() |
---|
34 | { |
---|
35 | //Do nothing since Respondent does not contain any references. |
---|
36 | } |
---|
37 | |
---|
38 | } |
---|
39 | |
---|
40 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.