Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Blog\Model;
- class Post
- {
- /**
- * @var int
- */
- private $id;
- /**
- * @var string
- */
- private $text;
- /**
- * @var string
- */
- private $title;
- /**
- * @param string $title
- * @param string $text
- * @param int|null $id
- */
- public function __construct($title, $text, $id = null)
- {
- $this->title = $title;
- $this->text = $text;
- $this->id = $id;
- }
- /**
- * @return int|null
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * @return string
- */
- public function getText()
- {
- return $this->text;
- }
- /**
- * @return string
- */
- public function getTitle()
- {
- return $this->title;
- }
- }
Add Comment
Please, Sign In to add comment