summaryrefslogtreecommitdiff
path: root/app/Model/HourlyRate.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Model/HourlyRate.php')
-rw-r--r--app/Model/HourlyRate.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/Model/HourlyRate.php b/app/Model/HourlyRate.php
index c2ce3eaf..1550bdae 100644
--- a/app/Model/HourlyRate.php
+++ b/app/Model/HourlyRate.php
@@ -21,6 +21,24 @@ class HourlyRate extends Base
const TABLE = 'hourly_rates';
/**
+ * Get all user rates for a given project
+ *
+ * @access public
+ * @param integer $project_id
+ * @return array
+ */
+ public function getAllByProject($project_id)
+ {
+ $members = $this->projectPermission->getMembers($project_id);
+
+ if (empty($members)) {
+ return array();
+ }
+
+ return $this->db->table(self::TABLE)->in('user_id', array_keys($members))->desc('date_effective')->findAll();
+ }
+
+ /**
* Get all rates for a given user
*
* @access public