title: Undefined Variable "name" in Enquiry.php (Symfony2)
body: <p>I have been following this tutorial: <a href="http://tutorial.symblog.co.uk" rel="nofollow">tutorial.symblog.co.uk</a>, and just finished up Part 2. I also followed what one of the users said in the comments about the deprecated functions that were part of the tutorial, and I fixed those in my code.</p>
  
  <p>However, I still get the following error when I try to submit my form:</p>
  
  <blockquote>ContextErrorException: Notice: Undefined variable: name in /private_html/symfony/symblog/src/Blogger/BlogBundle/Entity/Enquiry.php line 22</blockquote>
  
  <p>I've looked through my Enquiry.php file, but haven't found anything.</p>
  
  <p>Here it is:</p>
  
  <pre><code>&lt;?php
  // src/Blogger/BlogBundle/Entity/Enquiry.php
  
  namespace Blogger\BlogBundle\Entity;
  
  use Symfony\Component\Validator\Mapping\ClassMetadata;
  use Symfony\Component\Validator\Constraints\NotBlank;
  use Symfony\Component\Validator\Constraints\Email;
  use Symfony\Component\Validator\Constraints\Length;
  
  class Enquiry {
      protected $name;
      protected $email;
      protected $subject;
      protected $body;
  
      public function getName() {
          return $this-&gt;name;
      }
  
      public function setName() {
          $this-&gt;name = $name; // Line 22
      }
  
      public function getEmail() {
          return $this-&gt;email;
      }
  
      public function setEmail() {
          $this-&gt;email = $email;
      }
  
      public function getSubject() {
          return $this-&gt;subject;
      }
  
      public function setSubject() {
          $this-&gt;subject = $subject;
      }
  
      public function getBody() {
          return $this-&gt;body;
      }
  
      public function setBody() {
          $this-&gt;body = $body;
      }
  
      public static function loadValidatorMetadata(ClassMetadata $metadata) {
          $metadata-&gt;addPropertyConstraint('name', new NotBlank())
              -&gt;addPropertyConstraint('email', new Email())
              -&gt;addPropertyConstraint('subject', new NotBlank())
              -&gt;addPropertyConstraint('subject', new Length(array('max'=&gt;50)))
              -&gt;addPropertyConstraint('body', new Length(array('min'=&gt;50)));
      }
  }
  </code></pre>
  
  <p>Thanks in advance!</p>