public function addMemberByInvitation(OrganizationInterface $organization, User $user, Invitation $invitation)
    {
        $this->addMember($organization, $user, $invitation->getRoles());

        $invitation->setStatus('accepted');
        $invitation->setTo($user);
        $this->dm->persist($invitation);
        $this->dm->flush();
    }
public function addMemberByInvitation(OrganizationInterface $organization, User $user, Invitation $invitation)
    {
        $this->addMember($organization, $user, $invitation->getRoles());

        $invitation->setStatus('accepted');
        $invitation->setTo($user);
        $this->dm->persist($invitation);
        $this->dm->flush();
    }
public function addMemberByInvitation ( OrganizationInterface $ organization , User $ user , Invitation $ invitation ) { $ this -> addMember ( $ organization , $ user , $ invitation -> getRoles ( ) ) ; $ invitation -> setStatus ( 'accepted' ) ; $ invitation -> setTo ( $ user ) ; $ this -> dm -> persist ( $ invitation ) ; $ this -> dm -> flush ( ) ; }
Add member to an Organization using settings from invitation

@param OrganizationInterface $organization
@param User         $user
@param Invitation   $invitation
Add member to an Organization using settings from invitation