I follow the instructions of @mark blog, and I can use my custom Model.php
and DboSource.php
without change the original files of CakePHP core.
Post: http://www.dereuromark.de/2011/10/31/freshly-baked-cake2-0-tips/
Using own classes instead of core ones
Let’s say, you want to apply a fix to a core file without overriding the core folder. Or you want to replace a file altogether.
Simply use the same folder structure inside the /Lib folder. For your own “FormAuthenticate” /app/Lib/Controller/Component/Auth/FormAuthenticate.php
Diff with CakePHP core files
The diff of my code and original cakephp core you found here: https://gist.github.com/patrickmaciel/7662749
Solution
I create a repository in github with all files needed for composite primary key work in CakePHP 2.x.
github: https://github.com/patrickmaciel/cakephp-composite-primary-key
This change allows you to use composite primary in your models, following this instructions:
// Add this in your model
public $primaryKey = false;
public $compositePrimaryKey = array('key_one', 'key_two', '........');
I hope this helps someone.