public function testTestGetGroupObjectByType3()
 {
     $groupFactory = new ReviewerGroupFactory();
     $this->assertTrue($groupFactory->getReviewer('selfReviewer') instanceof SelfReviewerGroup);
 }
示例#2
0
 /**
  *
  * @return Doctrine_Collection 
  */
 public function getReviewers($type = null)
 {
     if ($this->getDefault('reviewId') > 0) {
         $reviewers = $this->getPerformanceReviewService()->searchReview(array('id' => $this->getDefault('reviewId')))->getReviewers();
         $reviewerGroupFactory = new ReviewerGroupFactory();
         if ($type != null) {
             $reviewersArray = array();
             foreach ($reviewers as $reviewer) {
                 if ($reviewerGroupFactory->getReviewer($type)->getId() == $reviewer->getReviewerGroupId()) {
                     $reviewersArray[] = $reviewer;
                 }
             }
             return $reviewersArray;
         } else {
             return $reviewers;
         }
     } else {
         return array();
     }
 }