API / Minn\Rest / CommentObject

CommentObject final readonly class

Minn\Rest\CommentObject · public/minn/src/Minn/Rest/CommentObject.php · 87 lines

The wp/v2 comment object; edit context adds the moderation-desk fields.

Constants and properties

privatereadonly Minn\Content\Comments $comments

Promoted from the constructor.

privatereadonly Minn\Content\Posts $posts

Promoted from the constructor.

privatereadonly Minn\Front\Permalinks $permalinks

Promoted from the constructor.

privatereadonly Minn\Rest\RestUrl $url

Promoted from the constructor.

privatereadonly Minn\Rest\Caller $caller

Promoted from the constructor.

Public

new__construct(Minn\Content\Comments $comments, Minn\Content\Posts $posts, Minn\Front\Permalinks $permalinks, Minn\Rest\RestUrl $url, Minn\Rest\Caller $caller)#
methodbuild(Minn\Content\CommentRecord $c, Minn\Rest\Context $context): array#

A comment in the context asked for, through rest_prepare_comment when a plugin hooks it.

methodurl(): Minn\Rest\RestUrl#

The REST URL builder.

Internals 1

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privatebuildFields(Minn\Content\CommentRecord $c, Minn\Rest\Context $context): array#

The wp/v2 comment shape, with the edit-context fields when asked.