original_string: protected function validateElement($field, $handler_id, $arguments = array())
      {
          if (is_array($field)) {
              $label = reset($field);
              $field = key($field);
          }
  
          $options = array(
              'field' => $field,
              'arguments' => (array) $arguments,
              'label' => empty($label) ? $this->text('Field') : $label
          );
  
          $result = $this->validator->run($handler_id, $this->submitted, $options);
  
          if ($result === true) {
              return true;
          }
  
          settype($result, 'array');
          $this->errors = gplcart_array_merge($this->errors, $result);
          return false;
      }
code: protected function validateElement($field, $handler_id, $arguments = array())
      {
          if (is_array($field)) {
              $label = reset($field);
              $field = key($field);
          }
  
          $options = array(
              'field' => $field,
              'arguments' => (array) $arguments,
              'label' => empty($label) ? $this->text('Field') : $label
          );
  
          $result = $this->validator->run($handler_id, $this->submitted, $options);
  
          if ($result === true) {
              return true;
          }
  
          settype($result, 'array');
          $this->errors = gplcart_array_merge($this->errors, $result);
          return false;
      }
code_tokens: protected function validateElement ( $ field , $ handler_id , $ arguments = array ( ) ) { if ( is_array ( $ field ) ) { $ label = reset ( $ field ) ; $ field = key ( $ field ) ; } $ options = array ( 'field' => $ field , 'arguments' => ( array ) $ arguments , 'label' => empty ( $ label ) ? $ this -> text ( 'Field' ) : $ label ) ; $ result = $ this -> validator -> run ( $ handler_id , $ this -> submitted , $ options ) ; if ( $ result === true ) { return true ; } settype ( $ result , 'array' ) ; $ this -> errors = gplcart_array_merge ( $ this -> errors , $ result ) ; return false ; }
docstring: Validates a single element
  @param string|array $field
  @param string $handler_id
  @param string|array $arguments
  @return boolean
docstring_tokens: Validates a single element