original_string: protected static function fieldCompare(Document $a, Document $b) {
          $field = self::$orderByField;
          if (property_exists('\CloudControl\Cms\storage\entities\Document', $field)) {
              return strcasecmp($a->{$field}, $b->{$field});
          }
  
          if (!isset($a->fields->{$field}[0])) {
              return -3;
          }
  
          if (!isset($b->fields->{$field}[0])) {
              return 3;
          }
  
          return strcasecmp($a->fields->{$field}[0], $b->fields->{$field}[0]);
      }
code: protected static function fieldCompare(Document $a, Document $b) {
          $field = self::$orderByField;
          if (property_exists('\CloudControl\Cms\storage\entities\Document', $field)) {
              return strcasecmp($a->{$field}, $b->{$field});
          }
  
          if (!isset($a->fields->{$field}[0])) {
              return -3;
          }
  
          if (!isset($b->fields->{$field}[0])) {
              return 3;
          }
  
          return strcasecmp($a->fields->{$field}[0], $b->fields->{$field}[0]);
      }
code_tokens: protected static function fieldCompare ( Document $ a , Document $ b ) { $ field = self :: $ orderByField ; if ( property_exists ( '\CloudControl\Cms\storage\entities\Document' , $ field ) ) { return strcasecmp ( $ a -> { $ field } , $ b -> { $ field } ) ; } if ( ! isset ( $ a -> fields -> { $ field } [ 0 ] ) ) { return - 3 ; } if ( ! isset ( $ b -> fields -> { $ field } [ 0 ] ) ) { return 3 ; } return strcasecmp ( $ a -> fields -> { $ field } [ 0 ] , $ b -> fields -> { $ field } [ 0 ] ) ; }
docstring: Compares two documents
  @param Document $a
  @param Document $b
  @return int
docstring_tokens: Compares two documents