title: CakePHP: Call to a member function set() on a non-object error
body: <p>My controller seems to be buggy here:</p>
  
  <pre><code>public function addAdmin($id) {
      $this-&gt;User-&gt;id = $id;
      $this-&gt;User-&gt;set('role','admin');
      $this-&gt;User-&gt;save();
  }
  </code></pre>
  
  <p>So it throws me the error <code>Call to a member function set() on a non-object</code>.</p>
  
  <p>Actually, I want to update the field 'role' in a table column called 'role' and set it to 'admin'.</p>
  
  <p>Can you imagine what's wrong? I've seen many tutorials using this with success but here apparently i'm missing something.</p>
  
  <p>PS: I'm a cakephp newbie :D</p>
  
  <p>Thank you in advance!</p>