PHP Classes

File: example/Entities/PostEntity.php

Recommend this page to a friend!
  Classes of Aleksandar Zivanovic   PHP Decorator Pattern   example/Entities/PostEntity.php   Download  
File: example/Entities/PostEntity.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: 469 bytes
 

Contents

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

namespace App\Entities;

use
PHPDecorator\Decoratable;

class
PostEntity
{
    use
Decoratable;

    private
$id = 0;
    private
$title = 'None';
    private
$content = '--empty--';

    public function
getId(): int
   
{
        return
$this->id;
    }

    public function
getTitle(): string
   
{
        return
$this->title;
    }

    public function
getContent(): string
   
{
        return
$this->content;
    }
}