class OneBoxResult in Google Search Appliance 8
Defines a value object for a one-box result.
Hierarchy
- class \Drupal\google_appliance\SearchResults\OneBoxResult
Expanded class hierarchy of OneBoxResult
1 file declares its use of OneBoxResult
- Parser.php in src/
Service/ Parser.php
File
- src/
SearchResults/ OneBoxResult.php, line 8
Namespace
Drupal\google_appliance\SearchResultsView source
class OneBoxResult {
/**
* Array of field values keyed by field name.
*
* @var string[]
*/
protected $fields = [];
/**
* Absolute URL.
*
* @var string
*/
protected $absoluteUrl;
/**
* Title.
*
* @var string
*/
protected $title;
/**
* Constructs a new OneBoxResult object.
*
* @param string $absoluteUrl
* Absolute URL.
* @param string $title
* Title.
*/
public function __construct($absoluteUrl, $title) {
$this->absoluteUrl = $absoluteUrl;
$this->title = $title;
}
/**
* Add field value.
*
* @param string $name
* Field name.
* @param string $value
* Field value.
*
* @return $this
*/
public function addFieldValue($name, $value) {
$this->fields[$name] = $value;
return $this;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
OneBoxResult:: |
protected | property | Absolute URL. | |
OneBoxResult:: |
protected | property | Array of field values keyed by field name. | |
OneBoxResult:: |
protected | property | Title. | |
OneBoxResult:: |
public | function | Add field value. | |
OneBoxResult:: |
public | function | Constructs a new OneBoxResult object. |