public function connectUserWithExistingCustomer($user, $customer)
    {
        $result = false;
        if ($user->getEmail() === $customer->getEmail()) {
            \call_user_func(
                [$customer->getAttribute(), 'set' . ucfirst($user->getType()) . 'Identity'],
                $user->getId()
            );
            $result = $this->udapteCustomerAttributes($customer);
        }

        return $result;
    }
public function connectUserWithExistingCustomer($user, $customer)
    {
        $result = false;
        if ($user->getEmail() === $customer->getEmail()) {
            \call_user_func(
                [$customer->getAttribute(), 'set' . ucfirst($user->getType()) . 'Identity'],
                $user->getId()
            );
            $result = $this->udapteCustomerAttributes($customer);
        }

        return $result;
    }
public function connectUserWithExistingCustomer ( $ user , $ customer ) { $ result = false ; if ( $ user -> getEmail ( ) === $ customer -> getEmail ( ) ) { \ call_user_func ( [ $ customer -> getAttribute ( ) , 'set' . ucfirst ( $ user -> getType ( ) ) . 'Identity' ] , $ user -> getId ( ) ) ; $ result = $ this -> udapteCustomerAttributes ( $ customer ) ; } return $ result ; }
Connects a user with an existing customer

@param User $user
@param Customer $customer

@return Customer|false Customer if connecting was successful, false if not (e.g. email adresses are not equal)
Connects a user with an existing customer