CakePHP HABTM List all related items

by admin on 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;
}

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>