Skip to content

Commit

Permalink
feat: add functions to get risks by class
Browse files Browse the repository at this point in the history
  • Loading branch information
xchopin committed Aug 22, 2019
1 parent ff3506b commit 7bc0186
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Model/Risk.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,29 @@ public static function findByClassAndUser(String $classId, String $userId)
return parent::get("risks/classes/$classId/users/$userId");
}

public static function findByClass(String $classId)
{
return parent::get("risks/classes/$classId");
}

public static function latestByClassAndUser(String $classId, String $userId)
{
return parent::get("risks/classes/$classId/users/$userId?date=latest");
}

public static function latestByClass(String $classId)
{
return parent::get("risks/classes/$classId?date=latest");
}

public static function findByClassAndUserAndDate(String $classId, String $userId, String $date)
{
return parent::get("risks/classes/$classId/users/$userId?date=$date");
}

public static function findByClassAndDate(String $classId, String $date)
{
return parent::get("risks/classes/$classId?date=$date");
}

}

0 comments on commit 7bc0186

Please sign in to comment.