title: Cakephp 2 model beforeSave() not being called
body: <p>I can't figure out why this code isn't working. The <code>beforeSave</code> is not being called. It's supposed to fail the save and put some lines in the debug log, but it actually does save OK and no lines are written in the debug log.</p>
  
  <pre><code>&lt;?php
  class Link extends AppModel {
      var $name = "Link";
      var $belongsTo = array('Category' =&gt; array('className' =&gt; 'Category', 'foreignKey' =&gt; 'category_id'));
  
    public function beforeSave(){
          if ($this-&gt;data[$this-&gt;alias]['id'] == null) {
              $this-&gt;log("new record", 'debug');
              $link = $this-&gt;find('first',array('conditions' =&gt; array('Link.status = 1 AND Link.category_id = '.$this-&gt;data[$this-&gt;alias]['category_id']), 'order' =&gt; array('Link.order DESC') ));
              if (is_null($link)) {
                  $this-&gt;data[$this-&gt;alias]['order'] = 1;
              }else{
                  $this-&gt;data[$this-&gt;alias]['order'] = $link['Link']['order'] + 1;
              }
          }
          else {
              $this-&gt;log("old record", 'debug');
          }
          return false;
      }
  }   
  ?&gt;
  </code></pre>
  
  <p>I am launching a save in the controller like this:</p>
  
  <pre><code>public function add($category_id = null)
      {
          if ($category_id == null) {
              $this-&gt;Session-&gt;setFlash(__('Category id cant be null'),'default', array('class' =&gt; 'error-message'));
              $this-&gt;redirect(array('action' =&gt; 'index', 'controller' =&gt; 'categories'));
          }
          else
          {
              if($this-&gt;request-&gt;is('post'))
              {
                  $this-&gt;Link-&gt;create();
                  $this-&gt;Link-&gt;set('category_id' =&gt; $category_id));
                  if($this-&gt;Link-&gt;save($this-&gt;request-&gt;data))
                  {
                      $this-&gt;Session-&gt;setFlash(__('The link has been saved'),'default', array('class' =&gt; 'success'));
                      $this-&gt;redirect(array('action' =&gt; 'index/'.$category_id));
                  }
                  else
                      $this-&gt;Session-&gt;setFlash(__('The link could not be saved. Please, try again.'),'default', array('class' =&gt; 'error-message'));
              }
              $this-&gt;set('category_id',$category_id);
          }
      }
  </code></pre>
  
  <p>Another question in StackOverflow points out that the <code>beforeSave</code> method needs to be declared in the Model. I've also done the same thing with another model.</p>