DTO\WebSocket\Message::$authorId for upcoming point update (https://github.com/artss/point/pull/13). Serialization config changed. Setter methods removed.

This commit is contained in:
Alexey Skobkin 2019-02-24 01:40:49 +03:00
parent f2b423ad8c
commit d528b45436
2 changed files with 13 additions and 83 deletions

View file

@ -29,6 +29,11 @@ class Message implements ValidableInterface
*/ */
private $author; private $author;
/**
* @var int
*/
private $authorId;
/** @var string|null */ /** @var string|null */
private $authorName; private $authorName;
@ -144,6 +149,7 @@ class Message implements ValidableInterface
case self::TYPE_POST: case self::TYPE_POST:
if ( if (
null !== $this->author && null !== $this->author &&
null !== $this->authorId &&
null !== $this->html && null !== $this->html &&
null !== $this->postId && null !== $this->postId &&
null !== $this->private && null !== $this->private &&
@ -156,6 +162,7 @@ class Message implements ValidableInterface
case self::TYPE_COMMENT; case self::TYPE_COMMENT;
if ( if (
null !== $this->author && null !== $this->author &&
null !== $this->authorId &&
null !== $this->commentId && null !== $this->commentId &&
null !== $this->html && null !== $this->html &&
null !== $this->postId && null !== $this->postId &&
@ -168,6 +175,7 @@ class Message implements ValidableInterface
case self::TYPE_COMMENT_RECOMMENDATION; case self::TYPE_COMMENT_RECOMMENDATION;
if ( if (
null !== $this->author && null !== $this->author &&
null !== $this->authorId &&
null !== $this->postId null !== $this->postId
) { ) {
return true; return true;
@ -190,19 +198,14 @@ class Message implements ValidableInterface
return $this->a; return $this->a;
} }
public function setA(string $a): void
{
$this->a = $a;
}
public function getAuthor(): string public function getAuthor(): string
{ {
return $this->author; return $this->author;
} }
public function setAuthor(string $author): void public function getAuthorId(): int
{ {
$this->author = $author; return $this->authorId;
} }
public function getAuthorName(): ?string public function getAuthorName(): ?string
@ -210,148 +213,73 @@ class Message implements ValidableInterface
return $this->authorName; return $this->authorName;
} }
public function setAuthorName(?string $authorName): void
{
$this->authorName = $authorName;
}
public function getCommentId(): ?int public function getCommentId(): ?int
{ {
return $this->commentId; return $this->commentId;
} }
public function setCommentId(?int $commentId): void
{
$this->commentId = $commentId;
}
public function getCut(): ?bool public function getCut(): ?bool
{ {
return $this->cut; return $this->cut;
} }
public function setCut(?bool $cut): void
{
$this->cut = $cut;
}
public function getFiles(): ?array public function getFiles(): ?array
{ {
return $this->files; return $this->files;
} }
public function setFiles(?array $files): void
{
$this->files = $files;
}
public function getHtml(): ?string public function getHtml(): ?string
{ {
return $this->html; return $this->html;
} }
public function setHtml(?string $html): void
{
$this->html = $html;
}
public function getLink(): ?string public function getLink(): ?string
{ {
return $this->link; return $this->link;
} }
public function setLink(?string $link): void
{
$this->link = $link;
}
public function getPostId(): string public function getPostId(): string
{ {
return $this->postId; return $this->postId;
} }
public function setPostId(string $postId): void
{
$this->postId = $postId;
}
public function getPrivate(): ?bool public function getPrivate(): ?bool
{ {
return $this->private; return $this->private;
} }
public function setPrivate(?bool $private): void
{
$this->private = $private;
}
public function getRcid(): ?int public function getRcid(): ?int
{ {
return $this->rcid; return $this->rcid;
} }
public function setRcid(?int $rcid): void
{
$this->rcid = $rcid;
}
public function getTags(): ?array public function getTags(): ?array
{ {
return $this->tags; return $this->tags;
} }
public function setTags(?array $tags): void
{
$this->tags = $tags;
}
public function getText(): string public function getText(): string
{ {
return $this->text; return $this->text;
} }
public function setText(string $text): void
{
$this->text = $text;
}
public function getTitle(): ?string public function getTitle(): ?string
{ {
return $this->title; return $this->title;
} }
public function setTitle(?string $title): void
{
$this->title = $title;
}
public function getToCommentId(): ?string public function getToCommentId(): ?string
{ {
return $this->toCommentId; return $this->toCommentId;
} }
public function setToCommentId(?string $toCommentId): void
{
$this->toCommentId = $toCommentId;
}
public function getToText(): ?string public function getToText(): ?string
{ {
return $this->toText; return $this->toText;
} }
public function setToText(?string $toText): void
{
$this->toText = $toText;
}
public function getToUsers(): ?array public function getToUsers(): ?array
{ {
return $this->toUsers; return $this->toUsers;
} }
public function setToUsers(?array $toUsers): void
{
$this->toUsers = $toUsers;
}
} }

View file

@ -1,6 +1,5 @@
Skobkin\Bundle\PointToolsBundle\DTO\Api\WebSocket\Message: Skobkin\Bundle\PointToolsBundle\DTO\Api\WebSocket\Message:
exclusion_policy: none exclusion_policy: none
access_type: public_method
properties: properties:
a: a:
type: string type: string
@ -8,6 +7,9 @@ Skobkin\Bundle\PointToolsBundle\DTO\Api\WebSocket\Message:
author: author:
type: string type: string
serialized_name: 'author' serialized_name: 'author'
authorId:
type: int
serialized_name: 'author_id'
authorName: authorName:
type: string type: string
serialized_name: 'author_name' serialized_name: 'author_name'