This post is based on Robert Conner’s code forCakePHP 1.x., and I made some changes to get it to work ...