PHP Trait Adldap\Models\Traits\HasMemberOfTrait

Show file Open project: adldap2/adldap2

Public Methods

Method Description
addGroup ( string | Group $group ) : boolean Adds the current model to the specified group.
getGroupNames ( boolean $recursive = false ) : array Returns the models groups names in a single dimension array.
getGroups ( array $fields = [], boolean $recursive = false ) : Collection Returns the models groups that it is apart of.
inGroup ( mixed $group, boolean $recursive = false ) : boolean Determine if the current model is a member of the specified group(s).
removeGroup ( string | Group $group ) : boolean Removes the current model from the specified group.

Protected Methods

Method Description
validateGroup ( Group | string $group, Group $parent ) : boolean Validates if the specified group is the given parent instance.

Method Details

addGroup() public method

Adds the current model to the specified group.
public addGroup ( string | Group $group ) : boolean
$group string | Adldap\Models\Group
return boolean

getGroupNames() public method

If a recursive option is given, groups of groups are retrieved and then merged with the resulting collection.
public getGroupNames ( boolean $recursive = false ) : array
$recursive boolean
return array

getGroups() public method

If a recursive option is given, groups of groups are retrieved and then merged with the resulting collection. https://msdn.microsoft.com/en-us/library/ms677099(v=vs.85).aspx
public getGroups ( array $fields = [], boolean $recursive = false ) : Collection
$fields array
$recursive boolean
return Illuminate\Support\Collection

inGroup() public method

Determine if the current model is a member of the specified group(s).
public inGroup ( mixed $group, boolean $recursive = false ) : boolean
$group mixed
$recursive boolean
return boolean

removeGroup() public method

Removes the current model from the specified group.
public removeGroup ( string | Group $group ) : boolean
$group string | Adldap\Models\Group
return boolean

validateGroup() protected method

Validates if the specified group is the given parent instance.
protected validateGroup ( Group | string $group, Group $parent ) : boolean
$group Adldap\Models\Group | string
$parent Adldap\Models\Group
return boolean