public static function findByUserId($id) { $userroles = UserRole::findAllFrom('UserRole', 'user_id=?', array((int) $id)); if (count($userroles) <= 0) { return false; } $roles = array(); foreach ($userroles as $role) { $roles[] = Role::findById($role->role_id); } return $roles; }