public function generateStringTo(array $receivers, array $groups, array $workspaces)
    {
        $usernames = [];

        foreach ($receivers as $receiver) {
            $usernames[] = $receiver->getUsername();
        }

        $string = implode(';', $usernames);

        foreach ($groups as $group) {
            $el = '{'.$group->getName().'}';
            $string .= '' === $string ? $el : ';'.$el;
        }

        foreach ($workspaces as $workspace) {
            $el = '['.$workspace->getCode().']';
            $string .= '' === $string ? $el : ';'.$el;
        }

        return $string;
    }
public function generateStringTo(array $receivers, array $groups, array $workspaces)
    {
        $usernames = [];

        foreach ($receivers as $receiver) {
            $usernames[] = $receiver->getUsername();
        }

        $string = implode(';', $usernames);

        foreach ($groups as $group) {
            $el = '{'.$group->getName().'}';
            $string .= '' === $string ? $el : ';'.$el;
        }

        foreach ($workspaces as $workspace) {
            $el = '['.$workspace->getCode().']';
            $string .= '' === $string ? $el : ';'.$el;
        }

        return $string;
    }
public function generateStringTo ( array $ receivers , array $ groups , array $ workspaces ) { $ usernames = [ ] ; foreach ( $ receivers as $ receiver ) { $ usernames [ ] = $ receiver -> getUsername ( ) ; } $ string = implode ( ';' , $ usernames ) ; foreach ( $ groups as $ group ) { $ el = '{' . $ group -> getName ( ) . '}' ; $ string .= '' === $ string ? $ el : ';' . $ el ; } foreach ( $ workspaces as $ workspace ) { $ el = '[' . $ workspace -> getCode ( ) . ']' ; $ string .= '' === $ string ? $ el : ';' . $ el ; } return $ string ; }
Generates a string containing the usernames from a list of users.

@param \Claroline\CoreBundle\Entity\User[]      $receivers
@param \Claroline\CoreBundle\Entity\Group[]     $groups
@param \Claroline\CoreBundle\Entity\Workspace[] $workspaces

@return string
Generates a string containing the usernames from a list of users .