-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtesting.class.php
46 lines (40 loc) · 1.56 KB
/
testing.class.php
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
<?php
// use the dPFramework to have easy database operations (store, delete etc.) by using its ObjectOrientedDesign
// therefore we have to create a child class for the module einstein
// a class named (like this) in the form: module/module.class.php is automatically loaded by the dPFramework
/**
* @package dotProject
* @subpackage modules
* @version $Revision: 1.0 $
*/
// include the powerful parent class that we want to extend for einstein
require_once( $AppUI->getSystemClass ('dp' ) ); // use the dPFramework for easy inclusion of this class here
/**
* The Einstein Class
*/
class CTesting extends CDpObject {
// link variables to the einstein object (according to the existing columns in the database table einstein)
var $unittest_id = NULL; //use NULL for a NEW object, so the database automatically assigns an unique id by 'NOT NULL'-functionality
var $unittest_name = NULL;
var $unittest_expectedresult = NULL;
var $unittest_description = NULL;
var $unittest_passed = NULL;
var $unittest_lasttested = NULL;
var $unittest_project_id = NULL;
var $unittest_task_id = NULL;
var $unittest_actualresult = NULL;
// the constructor of the CEinstein class, always combined with the table name and the unique key of the table
function CTesting() {
$this->CDpObject( 'unittest', 'unittest_id' );
}
// overload the delete method of the parent class for adaptation for einstein's needs
function delete() {
$sql = "DELETE FROM unittest WHERE unittest_id = $this->unittest_id";
if (!db_exec( $sql )) {
return db_error();
} else {
return NULL;
}
}
}
?>