Skip to content

Commit 615e0aa

Browse files
committed
feat: add risk model
1 parent edc613e commit 615e0aa

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

src/Model/Risk.php

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
3+
/**
4+
*
5+
* Class entity
6+
*
7+
* @copyright Apereo
8+
* @category OpenLRW
9+
* @package Entity
10+
* @author Xavier Chopin <bonjour@xavierchop.in>
11+
* @license http://www.osedu.org/licenses/ECL-2.0 ECL-2.0 License
12+
*/
13+
14+
namespace OpenLRW\Model;
15+
16+
class Risk extends OneRoster
17+
{
18+
protected static $collection = 'risk';
19+
20+
protected $fillable = [
21+
'sourcedId',
22+
'userSourcedId',
23+
'classSourcedId',
24+
'modelType',
25+
'score',
26+
'name',
27+
'velocity',
28+
'dateTime',
29+
'active',
30+
'metadata'
31+
];
32+
33+
public static function findByClassAndUser(String $classId, String $userId)
34+
{
35+
return parent::get("risks/classes/$classId/users/$userId", Risk::class);
36+
}
37+
38+
public static function latestByClassAndUser(String $classId, String $userId)
39+
{
40+
return parent::get("risks/classes/$classId/users/$userId?date=latest", Risk::class);
41+
}
42+
43+
44+
}

0 commit comments

Comments
 (0)