Added very basic forum functionality
This commit is contained in:
216
src/KekRozsak/FrontBundle/Entity/ForumPost.php
Normal file
216
src/KekRozsak/FrontBundle/Entity/ForumPost.php
Normal file
@@ -0,0 +1,216 @@
|
||||
<?php
|
||||
|
||||
namespace KekRozsak\FrontBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* KekRozsak\FrontBundle\Entity\ForumPost
|
||||
*/
|
||||
class ForumPost
|
||||
{
|
||||
/**
|
||||
* @var integer $id
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var datetime $created_at
|
||||
*/
|
||||
private $created_at;
|
||||
|
||||
/**
|
||||
* @var datetime $updated_at
|
||||
*/
|
||||
private $updated_at;
|
||||
|
||||
/**
|
||||
* @var string $update_reason
|
||||
*/
|
||||
private $update_reason;
|
||||
|
||||
/**
|
||||
* @var text $text
|
||||
*/
|
||||
private $text;
|
||||
|
||||
/**
|
||||
* @var KekRozsak\FrontBundle\Entity\User
|
||||
*/
|
||||
private $created_by;
|
||||
|
||||
/**
|
||||
* @var KekRozsak\FrontBundle\Entity\User
|
||||
*/
|
||||
private $updated_by;
|
||||
|
||||
/**
|
||||
* @var KekRozsak\FrontBundle\Entity\ForumTopic
|
||||
*/
|
||||
private $topic;
|
||||
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set created_at
|
||||
*
|
||||
* @param datetime $createdAt
|
||||
* @return ForumPost
|
||||
*/
|
||||
public function setCreatedAt($createdAt)
|
||||
{
|
||||
$this->created_at = $createdAt;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get created_at
|
||||
*
|
||||
* @return datetime
|
||||
*/
|
||||
public function getCreatedAt()
|
||||
{
|
||||
return $this->created_at;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set updated_at
|
||||
*
|
||||
* @param datetime $updatedAt
|
||||
* @return ForumPost
|
||||
*/
|
||||
public function setUpdatedAt($updatedAt)
|
||||
{
|
||||
$this->updated_at = $updatedAt;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get updated_at
|
||||
*
|
||||
* @return datetime
|
||||
*/
|
||||
public function getUpdatedAt()
|
||||
{
|
||||
return $this->updated_at;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set update_reason
|
||||
*
|
||||
* @param string $updateReason
|
||||
* @return ForumPost
|
||||
*/
|
||||
public function setUpdateReason($updateReason)
|
||||
{
|
||||
$this->update_reason = $updateReason;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get update_reason
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdateReason()
|
||||
{
|
||||
return $this->update_reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set text
|
||||
*
|
||||
* @param text $text
|
||||
* @return ForumPost
|
||||
*/
|
||||
public function setText($text)
|
||||
{
|
||||
$this->text = $text;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get text
|
||||
*
|
||||
* @return text
|
||||
*/
|
||||
public function getText()
|
||||
{
|
||||
return $this->text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set created_by
|
||||
*
|
||||
* @param KekRozsak\FrontBundle\Entity\User $createdBy
|
||||
* @return ForumPost
|
||||
*/
|
||||
public function setCreatedBy(\KekRozsak\FrontBundle\Entity\User $createdBy = null)
|
||||
{
|
||||
$this->created_by = $createdBy;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get created_by
|
||||
*
|
||||
* @return KekRozsak\FrontBundle\Entity\User
|
||||
*/
|
||||
public function getCreatedBy()
|
||||
{
|
||||
return $this->created_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set updated_by
|
||||
*
|
||||
* @param KekRozsak\FrontBundle\Entity\User $updatedBy
|
||||
* @return ForumPost
|
||||
*/
|
||||
public function setUpdatedBy(\KekRozsak\FrontBundle\Entity\User $updatedBy = null)
|
||||
{
|
||||
$this->updated_by = $updatedBy;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get updated_by
|
||||
*
|
||||
* @return KekRozsak\FrontBundle\Entity\User
|
||||
*/
|
||||
public function getUpdatedBy()
|
||||
{
|
||||
return $this->updated_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set topic
|
||||
*
|
||||
* @param KekRozsak\FrontBundle\Entity\ForumTopic $topic
|
||||
* @return ForumPost
|
||||
*/
|
||||
public function setTopic(\KekRozsak\FrontBundle\Entity\ForumTopic $topic = null)
|
||||
{
|
||||
$this->topic = $topic;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get topic
|
||||
*
|
||||
* @return KekRozsak\FrontBundle\Entity\ForumTopic
|
||||
*/
|
||||
public function getTopic()
|
||||
{
|
||||
return $this->topic;
|
||||
}
|
||||
}
|
@@ -240,4 +240,35 @@ class ForumTopic
|
||||
{
|
||||
return $this->topic_group;
|
||||
}
|
||||
/**
|
||||
* @var \Doctrine\Common\Collections\ArrayCollection
|
||||
*/
|
||||
private $posts;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->posts = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add posts
|
||||
*
|
||||
* @param KekRozsak\FrontBundle\Entity\ForumPost $posts
|
||||
* @return ForumTopic
|
||||
*/
|
||||
public function addForumPost(\KekRozsak\FrontBundle\Entity\ForumPost $posts)
|
||||
{
|
||||
$this->posts[] = $posts;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get posts
|
||||
*
|
||||
* @return Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
public function getPosts()
|
||||
{
|
||||
return $this->posts;
|
||||
}
|
||||
}
|
@@ -200,4 +200,58 @@ class User implements UserInterface
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
/**
|
||||
* @var \Doctrine\Common\Collections\ArrayCollection
|
||||
*/
|
||||
private $articles;
|
||||
|
||||
/**
|
||||
* @var \Doctrine\Common\Collections\ArrayCollection
|
||||
*/
|
||||
private $forum_posts;
|
||||
|
||||
|
||||
/**
|
||||
* Add articles
|
||||
*
|
||||
* @param KekRozsak\FrontBundle\Entity\Article $articles
|
||||
* @return User
|
||||
*/
|
||||
public function addArticle(\KekRozsak\FrontBundle\Entity\Article $articles)
|
||||
{
|
||||
$this->articles[] = $articles;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get articles
|
||||
*
|
||||
* @return Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
public function getArticles()
|
||||
{
|
||||
return $this->articles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add forum_posts
|
||||
*
|
||||
* @param KekRozsak\FrontBundle\Entity\ForumPost $forumPosts
|
||||
* @return User
|
||||
*/
|
||||
public function addForumPost(\KekRozsak\FrontBundle\Entity\ForumPost $forumPosts)
|
||||
{
|
||||
$this->forum_posts[] = $forumPosts;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get forum_posts
|
||||
*
|
||||
* @return Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
public function getForumPosts()
|
||||
{
|
||||
return $this->forum_posts;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user