You are here

function slickgrid_editors::set_error in Slickgrid 7

Same name and namespace in other branches
  1. 7.2 plugins/editors/handler.class.php \slickgrid_editors::set_error()

Log an error to the editor

Parameters

entity id $id:

strign - error $error:

where in the process the error is - either submit or validate $op:

File

plugins/editors/handler.class.php, line 70

Class

slickgrid_editors
Base class for export UI.

Code

function set_error($id, $error, $op = 'validate') {

  // Register the error
  $this->errors[$id] = t('%title can not be edited: @error', array(
    '%title' => $this->entities[$id]->title,
    '@error' => $error,
  ));

  // Remove the entity so it won't be updated
  unset($this->entities[$id]);

  // If there's an error callback, call it
  if (isset($this->error_callback)) {
    call_user_func_array($this->error_callback, array(
      $id,
      $this->errors[$id],
      $op,
    ));
  }
}