private function validateRoleArray($role_array) { $role_model = new RoleModel(); $response = array(); $role_exists = $role_model->roleExists($role_array[PermissionRoleTable::staff_role_id]); if (!$role_exists) { # code... $response[P_STATUS] = STATUS_ERROR; $response[P_MESSAGE] = "Invalid role!"; return $response; } $permission_exists = $role_model->permissionExists($role_array[PermissionRoleTable::staff_permission_id]); if (!$permission_exists) { # code... $response[P_STATUS] = STATUS_ERROR; $response[P_MESSAGE] = "Invalid permission!"; return $response; } $response[P_STATUS] = STATUS_OK; return $response; }