Described a bit topic base class and methods.

This commit is contained in:
conky
2022-10-13 23:52:21 +03:00
parent f3d397404f
commit c6f0c7d8f7
3 changed files with 45 additions and 2 deletions

View File

@@ -2,8 +2,37 @@
namespace Toloka\PhpApi;
abstract class TopicBase implements TopicInterface {
class TopicBase implements TopicInterface {
protected Client $client;
protected int $id;
public function __construct(
Client $client
) {
$this->client = $client;
}
/**
* @return int
*/
public function id(): int {
return $this->id;
}
/**
* @param int $id
*/
public function setId(int $id): void {
$this->id = $id;
}
/**
* {@inheritDoc}
*/
public function url(bool $absolute = TRUE): string {
return $this->client->getBaseUrl() . 't' . $this->id();
}
}