public function sendToUser($template, User $user, $parameters = []) { $template = $this->twig->loadTemplate($template); $parameters['user'] = $user; $subject = $template->renderBlock('subject', $parameters); $bodyHtml = $template->renderBlock('body_html', $parameters); $bodyText = $template->renderBlock('body_text', $parameters); return $this->send($subject, $bodyText, $bodyHtml, [$this->params['base.email'] => $this->params['base.contact']], [$user->getEmail() => $user->getUsername()]); }
public function equals(User $user) { if (!$user instanceof User) { return false; } if ($this->password !== $user->getPassword()) { return false; } if ($this->getSalt() !== $user->getSalt()) { return false; } if ($this->username !== $user->getUsername()) { return false; } if ($this->email !== $user->getEmail()) { return false; } return true; }