Sunday, December 16, 2018

Cakephp: Custom relation with table

$options['joins'] = array(
    array('table' => 'security_prices',
        'alias' => 'SecurityPrice',
        'type' => 'LEFT',
        'conditions' => array(
            'Security.ticker = SecurityPrice.ticker',
        )
    )
);

$Security->find('all', $options);


https://stackoverflow.com/questions/19092608/cakephp-linking-a-hasmany-relationship-with-a-different-index