Newscoop\Entity\User::getEmail PHP Method

getEmail() public method

Get email
public getEmail ( ) : string
return string
    public function getEmail()
    {
        return $this->email;
    }

Usage Example

 public function indexAction()
 {
     $form = new Application_Form_Profile();
     $form->setMethod('POST');
     $form->setDefaultsFromEntity($this->user);
     $request = $this->getRequest();
     if ($request->isPost() && $form->isValid($request->getPost())) {
         $values = $form->getValues();
         try {
             if (!empty($values['image'])) {
                 $imageInfo = array_pop($form->image->getFileInfo());
                 $values['image'] = $this->_helper->service('image')->save($imageInfo);
             }
             $this->service->save($values, $this->user);
             $this->_helper->redirector('index');
         } catch (\InvalidArgumentException $e) {
             switch ($e->getMessage()) {
                 case 'username_conflict':
                     $form->username->addError($this->view->translate("User with given username exists."));
                     break;
                 default:
                     $form->image->addError($e->getMessage());
                     break;
             }
         }
     }
     $this->view->user_first_name = $this->user->getFirstName();
     $this->view->user_last_name = $this->user->getLastName();
     $this->view->user_email = $this->user->getEmail();
     $this->view->form = $form;
     $this->view->user = new MetaUser($this->user);
     $this->view->first_time = $this->_getParam('first', false);
 }
All Usage Examples Of Newscoop\Entity\User::getEmail