In Cakephp 3.x I can use:
$myvar = TableRegistry::getTableLocator()->get('tablename')
To populate $myvar with information.
But what is the equivalent for the code above in CakePhp 2.9?
And which class do I have to add?
In CakePhp 3.x it seems to be use Cake\ORM\TableRegistry;
I'm assuming you want to get your table in a controller.
In that case, you can load a model like this:
In your controller
More here