PHP Classes

File: example/Entities/CommentEntity.php

Recommend this page to a friend!
  Classes of Aleksandar Zivanovic   PHP Decorator Pattern   example/Entities/CommentEntity.php   Download  
File: example/Entities/CommentEntity.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Decorator Pattern
Implement the decorator pattern using a trait
Author: By
Last change:
Date: 5 years ago
Size: 449 bytes
 

Contents

Class file image Download
<?php
/**
 * Author: Aleksandar Zivanovic
 */

namespace App\Entities;

use
PHPDecorator\Decoratable;

class
CommentEntity
{
    use
Decoratable;

    private
$postId;

    private
$comment = '--empty comment--';

   
/**
     * @return mixed
     */
   
public function getPostId()
    {
        return
$this->postId;
    }

   
/**
     * @return string
     */
   
public function getComment(): string
   
{
        return
$this->comment;
    }
}