plugin/team/Manager/TeamManager.php
public function registerManagersToTeam(Team $team, array $users)
    {
        $teamManagerRole = $team->getTeamManagerRole();

        if (!is_null($teamManagerRole) && 0 < count($users)) {
            $this->om->startFlushSuite();

            $team->setTeamManager($users[0]);

            foreach ($users as $user) {
                $this->roleManager->associateRole($user, $teamManagerRole);
            }
            $this->om->persist($team);
            $this->om->endFlushSuite();
        }
    }
public function registerManagersToTeam(Team $team, array $users)
    {
        $teamManagerRole = $team->getTeamManagerRole();

        if (!is_null($teamManagerRole) && 0 < count($users)) {
            $this->om->startFlushSuite();

            $team->setTeamManager($users[0]);

            foreach ($users as $user) {
                $this->roleManager->associateRole($user, $teamManagerRole);
            }
            $this->om->persist($team);
            $this->om->endFlushSuite();
        }
    }
public function registerManagersToTeam ( Team $ team , array $ users ) { $ teamManagerRole = $ team -> getTeamManagerRole ( ) ; if ( ! is_null ( $ teamManagerRole ) && 0 < count ( $ users ) ) { $ this -> om -> startFlushSuite ( ) ; $ team -> setTeamManager ( $ users [ 0 ] ) ; foreach ( $ users as $ user ) { $ this -> roleManager -> associateRole ( $ user , $ teamManagerRole ) ; } $ this -> om -> persist ( $ team ) ; $ this -> om -> endFlushSuite ( ) ; } }
Registers users as team managers.

@param Team  $team
@param array $users
Registers users as team managers .