title: CakePHP Error: Call to a member function save() on a non-object
body: <p>I am tryin to run the following action:</p>
  
  <pre><code>public function add() {
  if (!empty($this-&gt;request-&gt;data)) {
      // We can save the User data:
      // it should be in $this-&gt;request-&gt;data['User']
  
      $user = $this-&gt;User-&gt;save($this-&gt;request-&gt;data);
  
      // If the user was saved, Now we add this information to the data
      // and save the Profile.
  
      if (!empty($user)) {
          // The ID of the newly created user has been set
          // as $this-&gt;User-&gt;id.
          $this-&gt;request-&gt;data['Employee']['user_id'] = $this-&gt;User-&gt;id;
  
          // Because our User hasOne Profile, we can access
          // the Profile model through the User model:
          $this-&gt;Employee-&gt;save($this-&gt;request-&gt;data);
      }
  }
  </code></pre>
  
  <p>When i run this i get the following error:</p>
  
  <pre><code>Error: Call to a member function save() on a non-object
  File: /var/www/bloglic-2013/cake/app/Controller/EmployeesController.php
  Line: 61
  </code></pre>
  
  <p>How come?</p>