Added forum topic creation feature

Fixes second half of issue #26

Signed-off-by: Gergely Polonkai (W00d5t0ck) <polesz@w00d5t0ck.info>
This commit is contained in:
Gergely Polonkai (W00d5t0ck)
2012-08-23 17:32:52 +02:00
parent 67bfa5f1e0
commit 4d8ae5c0f0
4 changed files with 83 additions and 3 deletions

View File

@@ -4,12 +4,19 @@ namespace KekRozsak\FrontBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints as DoctrineAssert;
use KekRozsak\SecurityBundle\Entity\User;
/**
* @ORM\Entity
* @ORM\Table(name="forum_topics")
* @ORM\Table(name="forum_topics", uniqueConstraints={
* @ORM\UniqueConstraint(columns={"topic_group_id", "title"}),
* @ORM\UniqueConstraint(columns={"topic_group_id", "slug"})
* })
* @DoctrineAssert\UniqueEntity(fields={"topicGroup", "title"}, message="Ilyen nevű téma már létezik ebben a témakörben. Kérlek válassz másikat!")
* @DoctrineAssert\UniqueEntity(fields={"topicGroup", "slug"}, message="Ilyen nevű téma már létezik ebben a témakörben. Kérlek válassz másikat!")
*/
class ForumTopic
{
@@ -112,7 +119,7 @@ class ForumTopic
* @var ForumTopicGroup $topicGroup
*
* @ORM\ManyToOne(targetEntity="ForumTopicGroup", inversedBy="topics")
* @ORM\JoinColumn(name="topic_group_id")
* @ORM\JoinColumn(name="topic_group_id", nullable=false)
*/
protected $topicGroup;