title: CakePHP linking a hasMany relationship with a different index
body: <p>I have a table of securities like so:</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `securities` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `ticker` varchar(36) NOT NULL,
    `name` varchar(180) NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `ticker` (`ticker`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=585 ;
  </code></pre>
  
  <p>I.e. the primary key is <code>id</code> whilst there is another unique index <code>ticker</code>.</p>
  
  <p>The <code>ticker</code> index refers to my other table, secuity_prices which has this </p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `security_prices` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `price_date` date NOT NULL,
    `ticker` varchar(36) NOT NULL,
    `price` decimal(10,6) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=88340 ;
  </code></pre>
  
  <p>I want to define a hasMany relationship between them such that security hasMany securityPrice [securityPrice belongsTo security].</p>
  
  <p>The problem I am having is that Cake is using the primary key of <code>security</code> to link to the <code>security_prices</code> table instead of the <code>ticker</code> field. How can I get the join to be made via the ticker?</p>
  
  <p>Here are my relationships:</p>
  
  <pre><code>//Security
    public $hasMany = array(
      'SecurityPrice' =&gt; array(
          'className' =&gt; 'SecurityPrice',
          'foreignKey' =&gt; 'ticker',
          )
      );
  
  //SecurityPrice
  public $belongsTo = array(
          'Security' =&gt;
              array(
                  'className' =&gt; 'Security',
                  'foreignKey' =&gt; 'ticker',
              )
      );
  </code></pre>