update
This commit is contained in:
@@ -9,9 +9,10 @@ use Carbon\Carbon;
|
||||
class VkPost
|
||||
{
|
||||
private int $id;
|
||||
private string $source_name;
|
||||
private bool $post = true;
|
||||
private string $text;
|
||||
private int $author_id;
|
||||
private int $from_id;
|
||||
private int $owner_id;
|
||||
private array $attachments = [];
|
||||
private Carbon $date;
|
||||
@@ -20,11 +21,12 @@ class VkPost
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'post' => (int) $this->post,
|
||||
'post' => $this->post ? "post" : "copy",
|
||||
'text' => $this->text,
|
||||
'author_id' => $this->author_id,
|
||||
'from_id' => $this->from_id,
|
||||
'owner_id' => $this->owner_id,
|
||||
'date' => $this->getDate()->toIso8601String(),
|
||||
'name' => $this->getSourceName(),
|
||||
'attachments' => $this->attachments,
|
||||
];
|
||||
}
|
||||
@@ -64,9 +66,9 @@ class VkPost
|
||||
return $this->text;
|
||||
}
|
||||
|
||||
public function getAuthorId(): int
|
||||
public function getFromId(): int
|
||||
{
|
||||
return $this->author_id;
|
||||
return $this->from_id;
|
||||
}
|
||||
|
||||
public function getDate(): Carbon
|
||||
@@ -82,6 +84,11 @@ class VkPost
|
||||
return $this->owner_id;
|
||||
}
|
||||
|
||||
public function getSourceName(): string
|
||||
{
|
||||
return $this->source_name;
|
||||
}
|
||||
|
||||
public function setId(int $id): void
|
||||
{
|
||||
$this->id = $id;
|
||||
@@ -92,9 +99,9 @@ class VkPost
|
||||
$this->text = $text;
|
||||
}
|
||||
|
||||
public function setAuthorId(int $author_id): void
|
||||
public function setFromId(int $from_id): void
|
||||
{
|
||||
$this->author_id = $author_id;
|
||||
$this->from_id = $from_id;
|
||||
}
|
||||
|
||||
public function setDate(string|int $date): void
|
||||
@@ -111,4 +118,9 @@ class VkPost
|
||||
{
|
||||
$this->attachments = $attachments;
|
||||
}
|
||||
|
||||
public function setSourceName(string $source_name): void
|
||||
{
|
||||
$this->source_name = $source_name;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user