public function getGroupNames($recursive = false)
    {
        $fields = [$this->schema->commonName(), $this->schema->memberOf()];

        $names = $this->getGroups($fields, $recursive)->map(function (Group $group) {
            return $group->getCommonName();
        })->toArray();

        return array_unique($names);
    }
public function getGroupNames($recursive = false)
    {
        $fields = [$this->schema->commonName(), $this->schema->memberOf()];

        $names = $this->getGroups($fields, $recursive)->map(function (Group $group) {
            return $group->getCommonName();
        })->toArray();

        return array_unique($names);
    }
public function getGroupNames ( $ recursive = false ) { $ fields = [ $ this -> schema -> commonName ( ) , $ this -> schema -> memberOf ( ) ] ; $ names = $ this -> getGroups ( $ fields , $ recursive ) -> map ( function ( Group $ group ) { return $ group -> getCommonName ( ) ; } ) -> toArray ( ) ; return array_unique ( $ names ) ; }
Returns the models groups names in a single dimension array.

If a recursive option is given, groups of groups
are retrieved and then merged with
the resulting collection.

@param bool $recursive

@return array
Returns the models groups names in a single dimension array .