2022-08-20 22:17:17 +02:00
|
|
|
<?php
|
|
|
|
|
2022-11-18 18:06:46 +01:00
|
|
|
namespace Core\Objects\Search;
|
2022-08-20 22:17:17 +02:00
|
|
|
|
2022-11-18 18:06:46 +01:00
|
|
|
use Core\Objects\ApiObject;
|
2022-08-20 22:17:17 +02:00
|
|
|
|
|
|
|
class SearchResult extends ApiObject {
|
|
|
|
|
|
|
|
private string $url;
|
|
|
|
private string $title;
|
|
|
|
private string $text;
|
|
|
|
|
|
|
|
public function __construct(string $url, string $title, string $text) {
|
|
|
|
$this->url = $url;
|
|
|
|
$this->title = $title;
|
|
|
|
$this->text = $text;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function jsonSerialize(): array {
|
|
|
|
return [
|
|
|
|
"url" => $this->url,
|
|
|
|
"title" => $this->title,
|
|
|
|
"text" => $this->text
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setUrl(string $url) {
|
|
|
|
$this->url = $url;
|
|
|
|
}
|
|
|
|
}
|