mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-02-23 17:22:41 +01:00
118 lines
1.6 KiB
PHP
118 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace DesignPatterns\Repository;
|
|
|
|
/**
|
|
* Post represents entity for some post that user left on the site
|
|
*
|
|
* Class Post
|
|
* @package DesignPatterns\Repository
|
|
*/
|
|
class Post
|
|
{
|
|
/**
|
|
* @var int
|
|
*/
|
|
private $id;
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $title;
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $text;
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $author;
|
|
|
|
/**
|
|
* @var \DateTime
|
|
*/
|
|
private $created;
|
|
|
|
/**
|
|
* @param int $id
|
|
*/
|
|
public function setId($id)
|
|
{
|
|
$this->id = $id;
|
|
}
|
|
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function getId()
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
/**
|
|
* @param string $author
|
|
*/
|
|
public function setAuthor($author)
|
|
{
|
|
$this->author = $author;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getAuthor()
|
|
{
|
|
return $this->author;
|
|
}
|
|
|
|
/**
|
|
* @param \DateTime $created
|
|
*/
|
|
public function setCreated($created)
|
|
{
|
|
$this->created = $created;
|
|
}
|
|
|
|
/**
|
|
* @return \DateTime
|
|
*/
|
|
public function getCreated()
|
|
{
|
|
return $this->created;
|
|
}
|
|
|
|
/**
|
|
* @param string $text
|
|
*/
|
|
public function setText($text)
|
|
{
|
|
$this->text = $text;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getText()
|
|
{
|
|
return $this->text;
|
|
}
|
|
|
|
/**
|
|
* @param string $title
|
|
*/
|
|
public function setTitle($title)
|
|
{
|
|
$this->title = $title;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getTitle()
|
|
{
|
|
return $this->title;
|
|
}
|
|
}
|