public function updateAddress(array $data, $user)
    {
        $this->getEventManager()->trigger('updateInfo.pre', $this, array('user' => $user, 'data' => $data));

        $form  = $this->getServiceManager()->get('playgrounduser_address_form');
        $form->bind($user);
        $form->setData($data);

        $filter = $user->getInputFilter();
        $filter->remove('password');
        $filter->remove('passwordVerify');
        $filter->remove('dob');

        $form->setInputFilter($filter);

        if ($form->isValid()) {
            $user = $this->getUserMapper()->update($user);
            $this->getEventManager()->trigger('updateInfo.post', $this, array('user' => $user, 'data' => $data));

            if ($user) {
                return $user;
            }
        }

        return false;
    }
public function updateAddress(array $data, $user)
    {
        $this->getEventManager()->trigger('updateInfo.pre', $this, array('user' => $user, 'data' => $data));

        $form  = $this->getServiceManager()->get('playgrounduser_address_form');
        $form->bind($user);
        $form->setData($data);

        $filter = $user->getInputFilter();
        $filter->remove('password');
        $filter->remove('passwordVerify');
        $filter->remove('dob');

        $form->setInputFilter($filter);

        if ($form->isValid()) {
            $user = $this->getUserMapper()->update($user);
            $this->getEventManager()->trigger('updateInfo.post', $this, array('user' => $user, 'data' => $data));

            if ($user) {
                return $user;
            }
        }

        return false;
    }
public function updateAddress ( array $ data , $ user ) { $ this -> getEventManager ( ) -> trigger ( 'updateInfo.pre' , $ this , array ( 'user' => $ user , 'data' => $ data ) ) ; $ form = $ this -> getServiceManager ( ) -> get ( 'playgrounduser_address_form' ) ; $ form -> bind ( $ user ) ; $ form -> setData ( $ data ) ; $ filter = $ user -> getInputFilter ( ) ; $ filter -> remove ( 'password' ) ; $ filter -> remove ( 'passwordVerify' ) ; $ filter -> remove ( 'dob' ) ; $ form -> setInputFilter ( $ filter ) ; if ( $ form -> isValid ( ) ) { $ user = $ this -> getUserMapper ( ) -> update ( $ user ) ; $ this -> getEventManager ( ) -> trigger ( 'updateInfo.post' , $ this , array ( 'user' => $ user , 'data' => $ data ) ) ; if ( $ user ) { return $ user ; } } return false ; }
Update user address informations

@param array                  $data
@param \PlaygroundUser\Entity\UserInterface $user
Update user address informations