Adldap\Models\Traits\HasMemberOfTrait::addGroup PHP 메소드

addGroup() 공개 메소드

Adds the current model to the specified group.
public addGroup ( string | Group $group ) : boolean
$group string | Adldap\Models\Group
리턴 boolean
    public function addGroup($group)
    {
        if (is_string($group)) {
            // If the group is a string, we'll assume the dev is passing
            // in a DN string of the group. We'll try to locate it.
            $group = $this->getQuery()->newInstance()->findByDn($group);
        }
        if ($group instanceof Group) {
            // If the group is Group model instance, we can
            // add the current models DN to the group.
            return $group->addMember($this->getDn());
        }
        return false;
    }