Described a bit topic base class and methods.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user