uiharu/src/Lookup/WebLookupResult.php

44 lines
1.1 KiB
PHP

<?php
namespace Uiharu\Lookup;
use Uiharu\Url;
use Index\MediaType;
abstract class WebLookupResult implements \Uiharu\ILookupResult {
protected Url $url;
protected MediaType $mediaType;
public function __construct(Url $url, MediaType $mediaType) {
$this->url = $url;
$this->mediaType = $mediaType;
}
public function getUrl(): Url {
return $this->url;
}
public abstract function getObjectType(): string;
public function hasMediaType(): bool {
return true;
}
public function getMediaType(): MediaType {
return $this->mediaType;
}
public abstract function hasColour(): bool;
public abstract function getColour(): int;
public abstract function hasTitle(): bool;
public abstract function getTitle(): string;
public abstract function hasSiteName(): bool;
public abstract function getSiteName(): string;
public abstract function hasDescription(): bool;
public abstract function getDescription(): string;
public abstract function hasPreviewImage(): bool;
public abstract function getPreviewImage(): string;
}