sathyashrayan

/Model/Post.php

Jul 2nd, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. <?php
  2. namespace Blog\Model;
  3. class Post
  4. {
  5.     /**
  6.      * @var int
  7.      */
  8.     private $id;
  9.  
  10.     /**
  11.      * @var string
  12.      */
  13.     private $text;
  14.  
  15.     /**
  16.      * @var string
  17.      */
  18.     private $title;
  19.  
  20.     /**
  21.      * @param string $title
  22.      * @param string $text
  23.      * @param int|null $id
  24.      */
  25.     public function __construct($title, $text, $id = null)
  26.     {
  27.         $this->title = $title;
  28.         $this->text = $text;
  29.         $this->id = $id;
  30.     }
  31.  
  32.     /**
  33.      * @return int|null
  34.      */
  35.     public function getId()
  36.     {
  37.         return $this->id;
  38.     }
  39.  
  40.     /**
  41.      * @return string
  42.      */
  43.     public function getText()
  44.     {
  45.         return $this->text;
  46.     }
  47.  
  48.     /**
  49.      * @return string
  50.      */
  51.     public function getTitle()
  52.     {
  53.         return $this->title;
  54.     }
  55. }
Add Comment
Please, Sign In to add comment