Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 1 | <?php |
| 2 | |
| 3 | namespace LdapRecord\Models\FreeIPA; |
| 4 | |
| 5 | class Group extends Entry |
| 6 | { |
| 7 | /** |
| 8 | * The object classes of the LDAP model. |
| 9 | * |
| 10 | * @var array |
| 11 | */ |
| 12 | public static $objectClasses = [ |
| 13 | 'top', |
| 14 | 'groupofnames', |
| 15 | 'nestedgroup', |
| 16 | 'ipausergroup', |
| 17 | 'posixgroup', |
| 18 | ]; |
| 19 | |
| 20 | /** |
| 21 | * The groups relationship. |
| 22 | * |
| 23 | * Retrieves groups that the current group is apart of. |
| 24 | * |
| 25 | * @return \LdapRecord\Models\Relations\HasMany |
| 26 | */ |
| 27 | public function groups() |
| 28 | { |
| 29 | return $this->hasMany(self::class, 'member'); |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * Retrieve the members of the group. |
| 34 | * |
| 35 | * @return \LdapRecord\Models\Relations\HasMany |
| 36 | */ |
| 37 | public function members() |
| 38 | { |
| 39 | return $this->hasMany(User::class, 'memberof')->using($this, 'member'); |
| 40 | } |
| 41 | } |