title: CakePHP 3 Entity Confusion
body: <p>Here is the issue I am facing all the time since I started to learn CakePHP 3 </p>
  
  <p>What is this concept of entity a real world example would help alot. </p>
  
  <pre><code>public function add()
  {
              // why do we have to create new entity / what is the role of entity here. 
      $comment = $this-&gt;Comments-&gt;newEntity();
  
      if ($this-&gt;request-&gt;is('post','put')) {
  
                      // why do we have to use this line after posting / what is the role of this line. 
  
          $comment = $this-&gt;Comments-&gt;patchEntity($comment,$this-&gt;request-&gt;data);
  
          if ($this-&gt;Comments-&gt;save($comment)) {
              $this-&gt;Flash-&gt;success('comment submitted successfully.');
          } else {
              $this-&gt;Flash-&gt;error('Sorry, comment could not be updated.');
          }
      }
  
      return $this-&gt;redirect($this-&gt;referer());
  }
  </code></pre>