original_string: protected function is_unique($value) : bool {
          global $DB;
          $datafield = $this->datafield();
          $where = "fieldid = ? AND {$datafield} = ?";
          $params = [$this->get_field()->get('id'), $value];
          if ($this->get('id')) {
              $where .= ' AND id <> ?';
              $params[] = $this->get('id');
          }
          return !$DB->record_exists_select('customfield_data', $where, $params);
      }
code: protected function is_unique($value) : bool {
          global $DB;
          $datafield = $this->datafield();
          $where = "fieldid = ? AND {$datafield} = ?";
          $params = [$this->get_field()->get('id'), $value];
          if ($this->get('id')) {
              $where .= ' AND id <> ?';
              $params[] = $this->get('id');
          }
          return !$DB->record_exists_select('customfield_data', $where, $params);
      }
code_tokens: protected function is_unique ( $ value ) : bool { global $ DB ; $ datafield = $ this -> datafield ( ) ; $ where = "fieldid = ? AND {$datafield} = ?" ; $ params = [ $ this -> get_field ( ) -> get ( 'id' ) , $ value ] ; if ( $ this -> get ( 'id' ) ) { $ where .= ' AND id <> ?' ; $ params [ ] = $ this -> get ( 'id' ) ; } return ! $ DB -> record_exists_select ( 'customfield_data' , $ where , $ params ) ; }
docstring: Checks if the value is unique
  
  @param mixed $value
  @return bool
docstring_tokens: Checks if the value is unique