コード例 #1
0
 /**
  * add action - adds an author to the repository
  *
  * @param \Vendor\Guestbook\Domain\Model\Author $author
  */
 public function addAction(\Vendor\Guestbook\Domain\Model\Author $author)
 {
     $this->fillInAuthData($author);
     $author->setDisable(1);
     $this->authorRepository->add($author);
     $baseURL = $this->request->getBaseUri();
     $this->persistenceManager->persistAll();
     $emailConfirmationURL = $baseURL . $this->getControllerContext()->getUriBuilder()->reset()->uriFor('activate', array('author' => $author), 'Author', $this->getControllerContext()->getRequest()->getControllerExtensionName());
     $this->sendEmail($emailConfirmationURL);
     file_put_contents('./debug.txt', print_r("\n-----------------\n", true), FILE_APPEND);
     file_put_contents('./debug.txt', print_r($emailConfirmationURL, true), FILE_APPEND);
     $this->redirect('list', 'Comment', NULL, NULL);
 }