You are here

function slickgrid_editors::set_error in Slickgrid 7.2

Same name and namespace in other branches
  1. 7 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:

1 call to slickgrid_editors::set_error()
slickgrid_editors::update in plugins/editors/handler.class.php
Do the actual update - passes the update to the plugin's process functions

File

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

Class

slickgrid_editors
Base class for slickgrid editor.

Code

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

  // Register the error
  $this->errors[$id] = t('%title can not be edited: <strong>@error</strong>', 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,
    ));
  }
}