blob: 10fd9340451ffaa34785efd796465219e089446f [file] [log] [blame]
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +02001<?php
2
3namespace LdapRecord\Models\FreeIPA;
4
5class 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}