I have three relationships in my database, actions, action types and social media. Every action has an action type and the same action type can be shared by many actions. Also, every action belongs to a specific social media which can be shared by many actions too. So within this context, "Action" is a join model between social media and action types.
I'm beginning with CakePHP and what I need is to generate a list with action types in the format social network - action type name. I've already set up the Action, ActionType and SocialMedia model associations in my app, but trying to execute
$actionTypes = Set::combine($this->Action->ActionType->find('all', array(
'fields' => array('ActionType.id',"CONCAT(SocialMedia.name,' ',ActionType.name) as name"),
'contain' => array('SocialMedia')
)),'{n}.ActionType.id','{n}.0.name');
Throws a SQL error saying that there's no such column SocialMedia.name