Skip to content

Commit 7664fc0

Browse files
committed
feat: add model User
1 parent 56ed87d commit 7664fc0

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

src/Model/User.php

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?php
2+
3+
/**
4+
*
5+
* User 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 User extends OneRoster
17+
{
18+
19+
protected static $collection = 'users';
20+
21+
protected $fillable = [
22+
'sourcedId',
23+
'status',
24+
'metadata',
25+
'username',
26+
'userId',
27+
'givenName',
28+
'familyName',
29+
'role',
30+
'identifier"',
31+
'email',
32+
'sms',
33+
'phone'
34+
];
35+
36+
37+
public static function enrollments(String $id)
38+
{
39+
return parent::get(static::$collection . "/$id/enrollments");
40+
}
41+
42+
public static function events(String $id)
43+
{
44+
return parent::get(static::$collection . "/$id/events");
45+
}
46+
47+
public static function eventsFrom(String $id, String $from)
48+
{
49+
return parent::get(static::$collection . "/$id/events?from=$from");
50+
}
51+
52+
public static function eventsFromTo(String $id, String $from, String $to)
53+
{
54+
return parent::get(static::$collection . "/$id/events?from=$from&to=$to");
55+
}
56+
57+
}

0 commit comments

Comments
 (0)