Skip to content

Commit

Permalink
Add class method for get user from course by status - refs #7768
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed Aug 28, 2015
1 parent ae83e3b commit c9acd1f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Chamilo/CoreBundle/Entity/Session.php
Expand Up @@ -987,4 +987,23 @@ public function getSendSubscriptionNotification()
return $this->sendSubscriptionNotification;
}

/**
* Get user from course by status
* @param \Chamilo\CoreBundle\Entity\Course $course
* @param string $status
* @return \Doctrine\Common\Collections\Collection|static
*/
public function getUserCourseSubscriptionsByStatus(Course $course, $status)
{
$criteria = Criteria::create()
->where(
Criteria::expr()->eq("course", $course)
)
->andWhere(
Criteria::expr()->eq("status", $status)
);

return $this->userCourseSubscriptions->matching($criteria);
}

}

0 comments on commit c9acd1f

Please sign in to comment.