Posts Tagged ‘combine’

CakePHP HABTM List all related items

by on Wednesday, May 29th, 2013

public function getRolePermisions( $roleId ){
  $employee = $this->find('all', array(
   'conditions' => array( 'RolePermission.role_id' => $roleId )
 ));
 $list = Set::combine($employee,'{n}.Permission.id','{n}.Permission.name');
 return $list;
}