Skip to content

ProductComment

The ProductComment object represents a single comment of a product.

classDiagram
  direction LR
  ProductComment --> Product
  ProductComment --> DateTime
  class Product{
  }
  class DateTime{
  }
  class ProductComment{
    int id
    bool isVerifiedByOrder
    string author
    float rate
    string content
    DateTime createdAt
    Product product
  }

Properties

Attribute name Type Description
id int The unique identifier of the product's comment.
isVerifiedByOrder bool Returns true if comment is written by a customer who bought the product.
author string The name of the author of the comment.
rate float Numerical rate of a product from 1 to 5.
content string Contents of the comment.
createdAt DateTime The DateTime object representing a moment the comment was created.
product Product The Product object associated with this comment.

Note

The rate property will be used in the future. Now it always returns the average rate of the product.

Examples

id property

{{ productComment.id }}
1

isVerifiedByOrder property

{{ productComment.isVerifiedByOrder }}
true

author property

{{ productComment.author }}
John Doe

rate property

{{ productComment.rate }}
4.5

content property

{{ productComment.content }}
My comment

createdAt property

{{ productComment.createdAt }}
13-06-2022 08:15

product property

{{ productComment.product.name }}
Super Phone