Moved everything under annotations.
Some review is still needed.
This commit is contained in:
@@ -4,292 +4,280 @@ namespace KekRozsak\FrontBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
use KekRozsak\FrontBundle\Entity\User;
|
||||
use KekRozsak\FrontBundle\Entity\ForumTopic;
|
||||
use KekRozsak\FrontBundle\Entity\ForumPost;
|
||||
|
||||
/**
|
||||
* KekRozsak\FrontBundle\Entity\ForumTopicGroup
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="forum_topic_groups")
|
||||
*/
|
||||
class ForumTopicGroup
|
||||
{
|
||||
/**
|
||||
* @var integer $id
|
||||
*/
|
||||
private $id;
|
||||
public function __construct()
|
||||
{
|
||||
$this->topic = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* @var string $title
|
||||
*/
|
||||
private $title;
|
||||
/**
|
||||
* @var integer $id
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string $slug
|
||||
*/
|
||||
private $slug;
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var datetime $created_at
|
||||
*/
|
||||
private $created_at;
|
||||
/**
|
||||
* @var string $title
|
||||
* @ORM\Column(type="string", length=100, unique=true)
|
||||
*/
|
||||
private $title;
|
||||
|
||||
/**
|
||||
* @var datetime $updated_at
|
||||
*/
|
||||
private $updated_at;
|
||||
/**
|
||||
* Set title
|
||||
*
|
||||
* @param string $title
|
||||
* @return ForumTopicGroup
|
||||
*/
|
||||
public function setTitle($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var text $update_reason
|
||||
*/
|
||||
private $update_reason;
|
||||
/**
|
||||
* Get title
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var KekRozsak\FrontBundle\Entity\User
|
||||
*/
|
||||
private $created_by;
|
||||
/**
|
||||
* @var string $slug
|
||||
* @ORM\Column(type="string", length=100, unique=true)
|
||||
*/
|
||||
private $slug;
|
||||
|
||||
/**
|
||||
* @var KekRozsak\FrontBundle\Entity\User
|
||||
*/
|
||||
private $updated_by;
|
||||
/**
|
||||
* Set slug
|
||||
*
|
||||
* @param string $slug
|
||||
* @return ForumTopicGroup
|
||||
*/
|
||||
public function setSlug($slug)
|
||||
{
|
||||
$this->slug = $slug;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get slug
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSlug()
|
||||
{
|
||||
return $this->slug;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
/**
|
||||
* @var datetime $createdAt
|
||||
* @ORM\Column(type="datetime", name="created_at")
|
||||
*/
|
||||
private $createdAt;
|
||||
|
||||
/**
|
||||
* Set title
|
||||
*
|
||||
* @param string $title
|
||||
* @return ForumTopicGroup
|
||||
*/
|
||||
public function setTitle($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set createdAt
|
||||
*
|
||||
* @param DateTime $createdAt
|
||||
* @return ForumTopicGroup
|
||||
*/
|
||||
public function setCreatedAt(\DateTime $createdAt)
|
||||
{
|
||||
$this->createdAt = $createdAt;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get title
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
/**
|
||||
* Get createdAt
|
||||
*
|
||||
* @return DateTime
|
||||
*/
|
||||
public function getCreatedAt()
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set slug
|
||||
*
|
||||
* @param string $slug
|
||||
* @return ForumTopicGroup
|
||||
*/
|
||||
public function setSlug($slug)
|
||||
{
|
||||
$this->slug = $slug;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* @var User
|
||||
* @ORM\ManyToOne(targetEntity="User")
|
||||
* @ORM\JoinColumn(name="created_by_id")
|
||||
*/
|
||||
private $createdBy;
|
||||
|
||||
/**
|
||||
* Get slug
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSlug()
|
||||
{
|
||||
return $this->slug;
|
||||
}
|
||||
/**
|
||||
* Set createdBy
|
||||
*
|
||||
* @param User $createdBy
|
||||
* @return ForumTopicGroup
|
||||
*/
|
||||
public function setCreatedBy(User $createdBy)
|
||||
{
|
||||
$this->createdBy = $createdBy;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set created_at
|
||||
*
|
||||
* @param datetime $createdAt
|
||||
* @return ForumTopicGroup
|
||||
*/
|
||||
public function setCreatedAt($createdAt)
|
||||
{
|
||||
$this->created_at = $createdAt;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Get createdBy
|
||||
*
|
||||
* @return User
|
||||
*/
|
||||
public function getCreatedBy()
|
||||
{
|
||||
return $this->createdBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get created_at
|
||||
*
|
||||
* @return datetime
|
||||
*/
|
||||
public function getCreatedAt()
|
||||
{
|
||||
return $this->created_at;
|
||||
}
|
||||
/**
|
||||
* @var datetime $updatedAt
|
||||
* @ORM\Column(type="datetime", name="updated_at", nullable=true)
|
||||
*/
|
||||
private $updatedAt;
|
||||
|
||||
/**
|
||||
* Set updated_at
|
||||
*
|
||||
* @param datetime $updatedAt
|
||||
* @return ForumTopicGroup
|
||||
*/
|
||||
public function setUpdatedAt($updatedAt)
|
||||
{
|
||||
$this->updated_at = $updatedAt;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set updatedAt
|
||||
*
|
||||
* @param DateTime $updatedAt
|
||||
* @return ForumTopicGroup
|
||||
*/
|
||||
public function setUpdatedAt(\DateTime $updatedAt = null)
|
||||
{
|
||||
$this->updatedAt = $updatedAt;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get updated_at
|
||||
*
|
||||
* @return datetime
|
||||
*/
|
||||
public function getUpdatedAt()
|
||||
{
|
||||
return $this->updated_at;
|
||||
}
|
||||
/**
|
||||
* Get updatedAt
|
||||
*
|
||||
* @return datetime
|
||||
*/
|
||||
public function getUpdatedAt()
|
||||
{
|
||||
return $this->updatedAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set update_reason
|
||||
*
|
||||
* @param text $updateReason
|
||||
* @return ForumTopicGroup
|
||||
*/
|
||||
public function setUpdateReason($updateReason)
|
||||
{
|
||||
$this->update_reason = $updateReason;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* @var User
|
||||
* @ORM\ManyToOne(targetEntity="User")
|
||||
* @ORM\JoinColumn(name="updated_by_id")
|
||||
*/
|
||||
private $updatedBy;
|
||||
|
||||
/**
|
||||
* Get update_reason
|
||||
*
|
||||
* @return text
|
||||
*/
|
||||
public function getUpdateReason()
|
||||
{
|
||||
return $this->update_reason;
|
||||
}
|
||||
/**
|
||||
* Set updatedBy
|
||||
*
|
||||
* @param User $updatedBy
|
||||
* @return ForumTopicGroup
|
||||
*/
|
||||
public function setUpdatedBy(User $updatedBy = null)
|
||||
{
|
||||
$this->updatedBy = $updatedBy;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set created_by
|
||||
*
|
||||
* @param KekRozsak\FrontBundle\Entity\User $createdBy
|
||||
* @return ForumTopicGroup
|
||||
*/
|
||||
public function setCreatedBy(\KekRozsak\FrontBundle\Entity\User $createdBy = null)
|
||||
{
|
||||
$this->created_by = $createdBy;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Get updatedBy
|
||||
*
|
||||
* @return User
|
||||
*/
|
||||
public function getUpdatedBy()
|
||||
{
|
||||
return $this->updatedBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get created_by
|
||||
*
|
||||
* @return KekRozsak\FrontBundle\Entity\User
|
||||
*/
|
||||
public function getCreatedBy()
|
||||
{
|
||||
return $this->created_by;
|
||||
}
|
||||
/**
|
||||
* @var text $update_reason
|
||||
* @ORM\Column(type="text", name="update_reason", nullable=true)
|
||||
*/
|
||||
private $updateReason;
|
||||
|
||||
/**
|
||||
* Set updated_by
|
||||
*
|
||||
* @param KekRozsak\FrontBundle\Entity\User $updatedBy
|
||||
* @return ForumTopicGroup
|
||||
*/
|
||||
public function setUpdatedBy(\KekRozsak\FrontBundle\Entity\User $updatedBy = null)
|
||||
{
|
||||
$this->updated_by = $updatedBy;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set updateReason
|
||||
*
|
||||
* @param text $updateReason
|
||||
* @return ForumTopicGroup
|
||||
*/
|
||||
public function setUpdateReason($updateReason = null)
|
||||
{
|
||||
$this->updateReason = $updateReason;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get updated_by
|
||||
*
|
||||
* @return KekRozsak\FrontBundle\Entity\User
|
||||
*/
|
||||
public function getUpdatedBy()
|
||||
{
|
||||
return $this->updated_by;
|
||||
}
|
||||
/**
|
||||
* @var \Doctrine\Common\Collections\ArrayCollection
|
||||
*/
|
||||
private $topic;
|
||||
/**
|
||||
* Get updateReason
|
||||
*
|
||||
* @return text
|
||||
*/
|
||||
public function getUpdateReason()
|
||||
{
|
||||
return $this->updateReason;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->topic = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add topic
|
||||
*
|
||||
* @param KekRozsak\FrontBundle\Entity\ForumTopic $topic
|
||||
* @return ForumTopicGroup
|
||||
*/
|
||||
public function addForumTopic(\KekRozsak\FrontBundle\Entity\ForumTopic $topic)
|
||||
{
|
||||
$this->topic[] = $topic;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* @var ForumPost
|
||||
* @ORM\OneToOne(targetEntity="ForumPost", cascade={"persist"})
|
||||
* @ORM\JoinColumn(name="last_post_id")
|
||||
*/
|
||||
private $lastPost;
|
||||
|
||||
/**
|
||||
* Get topic
|
||||
*
|
||||
* @return Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
public function getTopic()
|
||||
{
|
||||
return $this->topic;
|
||||
}
|
||||
/**
|
||||
* @var \Doctrine\Common\Collections\ArrayCollection
|
||||
*/
|
||||
private $topics;
|
||||
/**
|
||||
* Set lastPost
|
||||
*
|
||||
* @param ForumPost $lastPost
|
||||
* @return ForumTopicGroup
|
||||
*/
|
||||
public function setLastPost(ForumPost $lastPost = null)
|
||||
{
|
||||
$this->lastPost = $lastPost;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get lastPost
|
||||
*
|
||||
* @return ForumPost
|
||||
*/
|
||||
public function getLastPost()
|
||||
{
|
||||
return $this->lastPost;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get topics
|
||||
*
|
||||
* @return Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
public function getTopics()
|
||||
{
|
||||
return $this->topics;
|
||||
}
|
||||
/**
|
||||
* @var KekRozsak\FrontBundle\Entity\ForumPost
|
||||
*/
|
||||
private $lastPost;
|
||||
/**
|
||||
* @var \Doctrine\Common\Collections\ArrayCollection
|
||||
* @ORM\OneToMany(targetEntity="ForumTopic", mappedBy="topicGroup")
|
||||
*/
|
||||
private $topics;
|
||||
|
||||
|
||||
/**
|
||||
* Set lastPost
|
||||
*
|
||||
* @param KekRozsak\FrontBundle\Entity\ForumPost $lastPost
|
||||
* @return ForumTopicGroup
|
||||
*/
|
||||
public function setLastPost(\KekRozsak\FrontBundle\Entity\ForumPost $lastPost = null)
|
||||
{
|
||||
$this->lastPost = $lastPost;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get lastPost
|
||||
*
|
||||
* @return KekRozsak\FrontBundle\Entity\ForumPost
|
||||
*/
|
||||
public function getLastPost()
|
||||
{
|
||||
return $this->lastPost;
|
||||
}
|
||||
/**
|
||||
* @var KekRozsak\FrontBundle\Entity\ForumPost
|
||||
*/
|
||||
private $last_post;
|
||||
|
||||
|
||||
}
|
||||
/**
|
||||
* Get topics
|
||||
*
|
||||
* @return Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
public function getTopics()
|
||||
{
|
||||
return $this->topics;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user