author | Giulio Cesare Solaroli <giulio.cesare@solaroli.it> | 2011-10-09 13:10:11 (UTC) |
---|---|---|
committer | Giulio Cesare Solaroli <giulio.cesare@solaroli.it> | 2011-10-09 13:10:11 (UTC) |
commit | b312e037ebba7c94abea9661bcf62c52b7d73fbf (patch) (unidiff) | |
tree | c7b411357990cef1d4938d2d4b06a54f7863ec13 /backend | |
parent | 647a8a53917dd15dc81caaeb36c658e18e579ab0 (diff) | |
parent | 2cab48422287390c36429d3a7ae96e9b5a444c81 (diff) | |
download | clipperz-b312e037ebba7c94abea9661bcf62c52b7d73fbf.zip clipperz-b312e037ebba7c94abea9661bcf62c52b7d73fbf.tar.gz clipperz-b312e037ebba7c94abea9661bcf62c52b7d73fbf.tar.bz2 |
Merge pull request #10 from jokajak/timestamp_fix
timestamp fix
-rw-r--r-- | backend/php/src/objects/class.record.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/backend/php/src/objects/class.record.php b/backend/php/src/objects/class.record.php index 37a9702..2ab5c4a 100644 --- a/backend/php/src/objects/class.record.php +++ b/backend/php/src/objects/class.record.php | |||
@@ -1,108 +1,108 @@ | |||
1 | <?php | 1 | <?php |
2 | /* | 2 | /* |
3 | This SQL query will create the table to store your object. | 3 | This SQL query will create the table to store your object. |
4 | 4 | ||
5 | CREATE TABLE `record` ( | 5 | CREATE TABLE `record` ( |
6 | `recordid` int(11) NOT NULL auto_increment, | 6 | `recordid` int(11) NOT NULL auto_increment, |
7 | `userid` int(11) NOT NULL, | 7 | `userid` int(11) NOT NULL, |
8 | `reference` VARCHAR(255) NOT NULL, | 8 | `reference` VARCHAR(255) NOT NULL, |
9 | `data` LONGTEXT NOT NULL, | 9 | `data` LONGTEXT NOT NULL, |
10 | `version` VARCHAR(255) NOT NULL, | 10 | `version` VARCHAR(255) NOT NULL, |
11 | `creation_date` TIMESTAMP NOT NULL, | 11 | `creation_date` TIMESTAMP NOT NULL, |
12 | `update_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | 12 | `update_date` TIMESTAMP NOT NULL, |
13 | `access_date` TIMESTAMP NOT NULL, INDEX(`userid`), PRIMARY KEY (`recordid`)) ENGINE=MyISAM; | 13 | `access_date` TIMESTAMP NOT NULL, INDEX(`userid`), PRIMARY KEY (`recordid`)) ENGINE=MyISAM; |
14 | */ | 14 | */ |
15 | 15 | ||
16 | /** | 16 | /** |
17 | * <b>record</b> class with integrated CRUD methods. | 17 | * <b>record</b> class with integrated CRUD methods. |
18 | * @author Php Object Generator | 18 | * @author Php Object Generator |
19 | * @version POG 3.0e / PHP5.1 MYSQL | 19 | * @version POG 3.0e / PHP5.1 MYSQL |
20 | * @see http://www.phpobjectgenerator.com/plog/tutorials/45/pdo-mysql | 20 | * @see http://www.phpobjectgenerator.com/plog/tutorials/45/pdo-mysql |
21 | * @copyright Free for personal & commercial use. (Offered under the BSD license) | 21 | * @copyright Free for personal & commercial use. (Offered under the BSD license) |
22 | * @link http://www.phpobjectgenerator.com/?language=php5.1&wrapper=pdo&pdoDriver=mysql&objectName=record&attributeList=array+%28%0A++0+%3D%3E+%27user%27%2C%0A++1+%3D%3E+%27recordversion%27%2C%0A++2+%3D%3E+%27reference%27%2C%0A++3+%3D%3E+%27data%27%2C%0A++4+%3D%3E+%27version%27%2C%0A++5+%3D%3E+%27creation_date%27%2C%0A++6+%3D%3E+%27update_date%27%2C%0A++7+%3D%3E+%27access_date%27%2C%0A%29&typeList=array%2B%2528%250A%2B%2B0%2B%253D%253E%2B%2527BELONGSTO%2527%252C%250A%2B%2B1%2B%253D%253E%2B%2527HASMANY%2527%252C%250A%2B%2B2%2B%253D%253E%2B%2527VARCHAR%2528255%2529%2527%252C%250A%2B%2B3%2B%253D%253E%2B%2527LONGTEXT%2527%252C%250A%2B%2B4%2B%253D%253E%2B%2527VARCHAR%2528255%2529%2527%252C%250A%2B%2B5%2B%253D%253E%2B%2527TIMESTAMP%2527%252C%250A%2B%2B6%2B%253D%253E%2B%2527TIMESTAMP%2527%252C%250A%2B%2B7%2B%253D%253E%2B%2527TIMESTAMP%2527%252C%250A%2529 | 22 | * @link http://www.phpobjectgenerator.com/?language=php5.1&wrapper=pdo&pdoDriver=mysql&objectName=record&attributeList=array+%28%0A++0+%3D%3E+%27user%27%2C%0A++1+%3D%3E+%27recordversion%27%2C%0A++2+%3D%3E+%27reference%27%2C%0A++3+%3D%3E+%27data%27%2C%0A++4+%3D%3E+%27version%27%2C%0A++5+%3D%3E+%27creation_date%27%2C%0A++6+%3D%3E+%27update_date%27%2C%0A++7+%3D%3E+%27access_date%27%2C%0A%29&typeList=array%2B%2528%250A%2B%2B0%2B%253D%253E%2B%2527BELONGSTO%2527%252C%250A%2B%2B1%2B%253D%253E%2B%2527HASMANY%2527%252C%250A%2B%2B2%2B%253D%253E%2B%2527VARCHAR%2528255%2529%2527%252C%250A%2B%2B3%2B%253D%253E%2B%2527LONGTEXT%2527%252C%250A%2B%2B4%2B%253D%253E%2B%2527VARCHAR%2528255%2529%2527%252C%250A%2B%2B5%2B%253D%253E%2B%2527TIMESTAMP%2527%252C%250A%2B%2B6%2B%253D%253E%2B%2527TIMESTAMP%2527%252C%250A%2B%2B7%2B%253D%253E%2B%2527TIMESTAMP%2527%252C%250A%2529 |
23 | */ | 23 | */ |
24 | include_once('class.pog_base.php'); | 24 | include_once('class.pog_base.php'); |
25 | class record extends POG_Base | 25 | class record extends POG_Base |
26 | { | 26 | { |
27 | public $recordId = ''; | 27 | public $recordId = ''; |
28 | 28 | ||
29 | /** | 29 | /** |
30 | * @var INT(11) | 30 | * @var INT(11) |
31 | */ | 31 | */ |
32 | public $userId; | 32 | public $userId; |
33 | 33 | ||
34 | /** | 34 | /** |
35 | * @var private array of recordversion objects | 35 | * @var private array of recordversion objects |
36 | */ | 36 | */ |
37 | private $_recordversionList = array(); | 37 | private $_recordversionList = array(); |
38 | 38 | ||
39 | /** | 39 | /** |
40 | * @var VARCHAR(255) | 40 | * @var VARCHAR(255) |
41 | */ | 41 | */ |
42 | public $reference; | 42 | public $reference; |
43 | 43 | ||
44 | /** | 44 | /** |
45 | * @var LONGTEXT | 45 | * @var LONGTEXT |
46 | */ | 46 | */ |
47 | public $data; | 47 | public $data; |
48 | 48 | ||
49 | /** | 49 | /** |
50 | * @var VARCHAR(255) | 50 | * @var VARCHAR(255) |
51 | */ | 51 | */ |
52 | public $version; | 52 | public $version; |
53 | 53 | ||
54 | /** | 54 | /** |
55 | * @var TIMESTAMP | 55 | * @var TIMESTAMP |
56 | */ | 56 | */ |
57 | public $creation_date; | 57 | public $creation_date; |
58 | 58 | ||
59 | /** | 59 | /** |
60 | * @var TIMESTAMP | 60 | * @var TIMESTAMP |
61 | */ | 61 | */ |
62 | public $update_date; | 62 | public $update_date; |
63 | 63 | ||
64 | /** | 64 | /** |
65 | * @var TIMESTAMP | 65 | * @var TIMESTAMP |
66 | */ | 66 | */ |
67 | public $access_date; | 67 | public $access_date; |
68 | 68 | ||
69 | public $pog_attribute_type = array( | 69 | public $pog_attribute_type = array( |
70 | "recordId" => array('db_attributes' => array("NUMERIC", "INT")), | 70 | "recordId" => array('db_attributes' => array("NUMERIC", "INT")), |
71 | "user" => array('db_attributes' => array("OBJECT", "BELONGSTO")), | 71 | "user" => array('db_attributes' => array("OBJECT", "BELONGSTO")), |
72 | "recordversion" => array('db_attributes' => array("OBJECT", "HASMANY")), | 72 | "recordversion" => array('db_attributes' => array("OBJECT", "HASMANY")), |
73 | "reference" => array('db_attributes' => array("TEXT", "VARCHAR", "255")), | 73 | "reference" => array('db_attributes' => array("TEXT", "VARCHAR", "255")), |
74 | "data" => array('db_attributes' => array("TEXT", "LONGTEXT")), | 74 | "data" => array('db_attributes' => array("TEXT", "LONGTEXT")), |
75 | "version" => array('db_attributes' => array("TEXT", "VARCHAR", "255")), | 75 | "version" => array('db_attributes' => array("TEXT", "VARCHAR", "255")), |
76 | "creation_date" => array('db_attributes' => array("NUMERIC", "TIMESTAMP")), | 76 | "creation_date" => array('db_attributes' => array("NUMERIC", "TIMESTAMP")), |
77 | "update_date" => array('db_attributes' => array("NUMERIC", "TIMESTAMP")), | 77 | "update_date" => array('db_attributes' => array("NUMERIC", "TIMESTAMP")), |
78 | "access_date" => array('db_attributes' => array("NUMERIC", "TIMESTAMP")), | 78 | "access_date" => array('db_attributes' => array("NUMERIC", "TIMESTAMP")), |
79 | ); | 79 | ); |
80 | public $pog_query; | 80 | public $pog_query; |
81 | 81 | ||
82 | 82 | ||
83 | /** | 83 | /** |
84 | * Getter for some private attributes | 84 | * Getter for some private attributes |
85 | * @return mixed $attribute | 85 | * @return mixed $attribute |
86 | */ | 86 | */ |
87 | public function __get($attribute) | 87 | public function __get($attribute) |
88 | { | 88 | { |
89 | if (isset($this->{"_".$attribute})) | 89 | if (isset($this->{"_".$attribute})) |
90 | { | 90 | { |
91 | return $this->{"_".$attribute}; | 91 | return $this->{"_".$attribute}; |
92 | } | 92 | } |
93 | else | 93 | else |
94 | { | 94 | { |
95 | return false; | 95 | return false; |
96 | } | 96 | } |
97 | } | 97 | } |
98 | 98 | ||
99 | function record($reference='', $data='', $version='', $creation_date='', $update_date='', $access_date='') | 99 | function record($reference='', $data='', $version='', $creation_date='', $update_date='', $access_date='') |
100 | { | 100 | { |
101 | $this->_recordversionList = array(); | 101 | $this->_recordversionList = array(); |
102 | $this->reference = $reference; | 102 | $this->reference = $reference; |
103 | $this->data = $data; | 103 | $this->data = $data; |
104 | $this->version = $version; | 104 | $this->version = $version; |
105 | $this->creation_date = $creation_date; | 105 | $this->creation_date = $creation_date; |
106 | $this->update_date = $update_date; | 106 | $this->update_date = $update_date; |
107 | $this->access_date = $access_date; | 107 | $this->access_date = $access_date; |
108 | } | 108 | } |