summaryrefslogtreecommitdiff
path: root/demos/time-tracker/protected/App_Code/Dao/TimeEntryDao.php
blob: 4bd74eb505751d0cc0043bc224d72ca492acb022 (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
<?php

class TimeEntryDao extends BaseDao
{
	public function addNewTimeEntry($entry)
	{
		$sqlmap = $this->getSqlMap();
		$sqlmap->insert('AddNewTimeEntry', $entry);
	}

	public function getTimeEntryByID($entryID)
	{
		$sqlmap = $this->getSqlMap();
		return $sqlmap->queryForObject('GetTimeEntryByID', $entryID);
	}

	public function deleteTimeEntry($entryID)
	{
		$sqlmap = $this->getSqlMap();
		$sqlmap->delete('DeleteTimeEntry', $entryID);
	}

	public function getTimeEntriesInProject($username, $projectID)
	{
		$sqlmap = $this->getSqlMap();
		$param['username'] = $username;
		$param['project'] = $projectID;
		return $sqlmap->queryForList('GetAllTimeEntriesByProjectIdAndUser', $param);
	}

	public function updateTimeEntry($entry)
	{
		$sqlmap = $this->getSqlMap();
		$sqlmap->update('UpdateTimeEntry', $entry);
	}
}

?>