You are here

public function Result::__construct in Google Search Appliance 8

Constructs a new Result object.

Parameters

string $absoluteUrl: Absolute URL.

string $encodedUrl: Encoded URL.

string $title: Title.

string $snippet: Snippet.

string $crawlDate: Crawl date.

string $mimeType: Mime Type.

int $level: Level.

File

src/SearchResults/Result.php, line 94

Class

Result
Defines a value object representing a search result.

Namespace

Drupal\google_appliance\SearchResults

Code

public function __construct($absoluteUrl, $encodedUrl, $title, $snippet, $crawlDate, $mimeType, $level = 1) {
  $this->absoluteUrl = $absoluteUrl;
  $this->shortUrl = substr($absoluteUrl, 0, 80) . (strlen($absoluteUrl) > 80 ? '...' : '');
  $this->encodedUrl = $encodedUrl;
  $this->title = $title;
  $this->snippet = $snippet;
  $this->crawlDate = $crawlDate;
  $this->mimeType = $mimeType;
  $this->level = $level;
}