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.
Uses 14
Used by 3
Constants and properties
| private | readonly Minn\Content\Comments $comments | Promoted from the constructor. |
| private | readonly Minn\Content\Posts $posts | Promoted from the constructor. |
| private | readonly Minn\Front\Permalinks $permalinks | Promoted from the constructor. |
| private | readonly Minn\Rest\RestUrl $url | Promoted from the constructor. |
| private | readonly 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)# | |
| method | build(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. |
| method | url(): 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.
| private | buildFields(Minn\Content\CommentRecord $c, Minn\Rest\Context $context): array# | The wp/v2 comment shape, with the edit-context fields when asked. |
Nothing matches.