public function processInvitationByHash(User $user, $hash)
    {
        $invitation = $this->dm->getRepository('WobbleCodeUserBundle:Invitation')->findOneBy(
            [
                'hash'   => $hash,
                'status' => 'pending'
            ]
        );

        if (!$invitation) {
            return false;
        }

        $organization = $invitation->getOrganization();
        $this->addMemberByInvitation($organization, $user, $invitation);

        return $organization;
    }
public function processInvitationByHash(User $user, $hash)
    {
        $invitation = $this->dm->getRepository('WobbleCodeUserBundle:Invitation')->findOneBy(
            [
                'hash'   => $hash,
                'status' => 'pending'
            ]
        );

        if (!$invitation) {
            return false;
        }

        $organization = $invitation->getOrganization();
        $this->addMemberByInvitation($organization, $user, $invitation);

        return $organization;
    }
public function processInvitationByHash ( User $ user , $ hash ) { $ invitation = $ this -> dm -> getRepository ( 'WobbleCodeUserBundle:Invitation' ) -> findOneBy ( [ 'hash' => $ hash , 'status' => 'pending' ] ) ; if ( ! $ invitation ) { return false ; } $ organization = $ invitation -> getOrganization ( ) ; $ this -> addMemberByInvitation ( $ organization , $ user , $ invitation ) ; return $ organization ; }
Finds an Invitation by Hash and add member if exists

@param User   $user
@param string $hash Secret Invitation Hash
Finds an Invitation by Hash and add member if exists