Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function getPreviousReviewId(PerformanceReview $performanceReview) {
- try {
- $id = $performanceReview->getId();
- $emp = $performanceReview->getEmployeeId();
- $year = date('Y', strtotime($performanceReview->getDueDate()));
- $query = 'SELECT id FROM hs_hr_performance_review pr
- WHERE pr.id < $id
- AND pr.employeeId = $emp
- (AND EXTRACT(YEAR FROM pr.dueDate) = $year
- OR EXTRACT(YEAR FROM pr.dueDate) = $year-1)';
- $conn = Doctrine_Manager::connection();
- $statement = $conn->prepare($query);
- $prevReviewId = $statement->execute();
- return $prevReviewId;
- }catch (Exception $e) {
- throw new DaoException($e->getMessage());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement