diff options
author | wei <> | 2006-07-18 23:39:13 +0000 |
---|---|---|
committer | wei <> | 2006-07-18 23:39:13 +0000 |
commit | 2fbc53d1f5d9e0a000717642d02558453bc610a8 (patch) | |
tree | 0ab6b464cf6b319f862e075ddd442558971c5aa6 /demos/time-tracker/protected/App_Code/TimeEntryDao.php | |
parent | 319df8f534520c8c926d0cdaa1f5577c7bd8a909 (diff) |
Add more tests and business code for time-tracker
Diffstat (limited to 'demos/time-tracker/protected/App_Code/TimeEntryDao.php')
-rw-r--r-- | demos/time-tracker/protected/App_Code/TimeEntryDao.php | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/demos/time-tracker/protected/App_Code/TimeEntryDao.php b/demos/time-tracker/protected/App_Code/TimeEntryDao.php new file mode 100644 index 00000000..60301f3b --- /dev/null +++ b/demos/time-tracker/protected/App_Code/TimeEntryDao.php @@ -0,0 +1,47 @@ +<?php
+
+class TimeEntryDao extends BaseDao
+{
+ public function addNewTimeEntry($entry)
+ {
+ $sqlmap = $this->getConnection();
+ $sqlmap->insert('AddNewTimeEntry', $entry);
+ }
+
+ public function getTimeEntryByID($entryID)
+ {
+ $sqlmap = $this->getConnection();
+ return $sqlmap->queryForObject('GetTimeEntryByID', $entryID);
+ }
+
+ public function deleteTimeEntry($entryID)
+ {
+ $sqlmap = $this->getConnection();
+ $sqlmap->delete('DeleteTimeEntry', $entryID);
+ }
+
+ public function getTimeEntriesInProject($username, $projectID)
+ {
+ $sqlmap = $this->getConnection();
+ $param['username'] = $username;
+ $param['project'] = $projectID;
+ return $sqlmap->queryForList('GetAllTimeEntriesByProjectIdAndUser', $param);
+ }
+
+ public function updateTimeEntry($entry)
+ {
+ $sqlmap = $this->getConnection();
+ $sqlmap->update('UpdateTimeEntry', $entry);
+ }
+
+ public function getTimeEntriesByDate($username, $start, $end)
+ {
+ $sqlmap = $this->getConnection();
+ $param['username'] = $username;
+ $param['startDate'] = $start;
+ $param['endDate'] = $end;
+ return $sqlmap->queryForList('GetTimeEntriesByDate', $param);
+ }
+}
+
+?>
\ No newline at end of file |