Moved everything under annotations.

Some review is still needed.
This commit is contained in:
Polonkai Gergely 2012-07-13 12:07:21 +02:00
parent 60b5eecbc8
commit 00190c3e37
41 changed files with 3264 additions and 2509 deletions

41
TODO
View File

@ -1,6 +1,6 @@
Article
public
roles who can access it
Polls (Entity already exists)
Groups (Entity already exists)
Article check if public
UserForumViewed
it should contain records that show the last viewed post in each forum topic
@ -35,18 +35,6 @@ ForumPost
edit count
text
Vote
id
creator
created at
active
text
others can add new answers
answers
id
creator
text
Library
id
owner
@ -58,7 +46,7 @@ Library
borrower returned
commentable
Program
Event
id
creator
created at
@ -68,34 +56,15 @@ Program
start time
end time (may be null)
description
location
commentable
Document
id
creator
created at
last edited by
last edited timestamp
last edit reason
title
slug
text
group - nullable, onetomany
PrivateChatMessage
id
from user
to user
timestamp
Group
id
name
created by
creation time
leader
members
GroupChatMessage
id
from user

View File

@ -1,16 +1,15 @@
KekRozsakAdminBundle:
resource: "@KekRozsakAdminBundle/Resources/config/routing.yml"
prefix: /admin
resource: "@KekRozsakAdminBundle/Controller/DefaultController.php"
type: annotation
KekRozsakSecurityBundle:
resource: "@KekRozsakSecurityBundle/Resources/config/routing.yml"
prefix: /
resource: "@KekRozsakSecurityBundle/Controller/DefaultController.php"
type: annotation
KekRozsakFrontBundle:
resource: "@KekRozsakFrontBundle/Resources/config/routing.yml"
prefix: /
KekRozsakFrontBundle_Default:
resource: "@KekRozsakFrontBundle/Controller/DefaultController.php"
type: annotation
# Internal routing configuration to handle ESI
#_internal:
# resource: "@FrameworkBundle/Resources/config/routing/internal.xml"
# prefix: /_internal
KekRozsakFrontBundle_Forum:
resource: "@KekRozsakFrontBundle/Controller/ForumController.php"
type: annotation

View File

@ -2,12 +2,23 @@
namespace KekRozsak\AdminBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
/**
* @Route("/admin")
*/
class DefaultController extends Controller
{
public function manageRegsAction($name)
{
return $this->render('KekRozsakAdminBundle:Default:manage_regs.html.twig');
}
/**
* @Route("/jelentkezok", name="KekRozsakAdminBundle_manage_reg")
*/
public function manageRegsAction()
{
$users = $this->getDoctrine()->getEntityManager()->createQuery('SELECT u FROM KekRozsakFrontBundle:User u WHERE u.acceptedBy IS NULL')->getResult();
return $this->render('KekRozsakAdminBundle:Default:manage_regs.html.twig', array (
'users' => $users,
));
}
}

View File

@ -22,7 +22,7 @@ class KekRozsakAdminExtension extends Extension
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.xml');
}
}

View File

@ -0,0 +1,4 @@
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
</container>

View File

@ -1,7 +0,0 @@
parameters:
# kek_rozsak_admin.example.class: KekRozsak\AdminBundle\Example
services:
# kek_rozsak_admin.example:
# class: %kek_rozsak_admin.example.class%
# arguments: [@service_id, "plain_value", %parameter%]

View File

@ -1 +1,32 @@
Juj!
{% extends '::main_template.html.twig' %}
{% block title %} - Jelentkezők{% endblock %}
{% block content %}
<h3>Jelentkezők</h3>
{% if users|length > 0 %}
<table>
<thead>
<tr>
<td>Felhasználónév</td>
<td>E-mail cím</td>
<td>Fórum-név</td>
<td>Regisztráció ideje</td>
</tr>
</thead>
<tbody>
{% for user in users %}
<tr>
<td>{{ user.username }}</td>
<td>{{ user.email }}</td>
<td>{{ user.displayName }}</td>
<td>{{ user.registeredAt|date('Y-m-d H:i') }}</td>
<td>
<form method="post" action="">
<button type="submit">Engedélyezem</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{%endblock content %}

View File

@ -2,21 +2,28 @@
namespace KekRozsak\FrontBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use KekRozsak\FrontBundle\Form\Type\UserType;
class DefaultController extends Controller
{
/**
* @Route("/", name="KekRozsakFrontBundle_homepage")
*/
public function homepageAction()
{
$mainPageArticle = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:Article')->findOneBy(array('main_page' => 1), true, array('created_at', 'DESC'), 1);
$mainPageArticle = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:Article')->findOneBy(array('mainPage' => 1), true, array('createdAt', 'DESC'), 1);
if (!$mainPageArticle)
throw $this->createNotFoundException('A keresett cikk nem létezik!');
return $this->forward('KekRozsakFrontBundle:Default:article', array('articleSlug' => $mainPageArticle->getSlug()));
}
/**
* @Route("/cikk/{articleSlug}", name="KekRozsakFrontBundle_article")
*/
public function articleAction($articleSlug)
{
$article = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:Article')->findOneBySlug($articleSlug);
@ -29,6 +36,9 @@ class DefaultController extends Controller
));
}
/**
* @Route("/profil", name="KekRozsakFrontBundle_profile_edit")
*/
public function profileEditAction()
{
$user = $this->get('security.context')->getToken()->getUser();

View File

@ -2,14 +2,21 @@
namespace KekRozsak\FrontBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use KekRozsak\FrontBundle\Entity\ForumPost;
use KekRozsak\FrontBundle\Form\Type\ForumPostType;
/**
* @Route("/forum")
*/
class ForumController extends Controller
{
/**
* @Route("", name="KekRozsakFrontBundle_forum_main")
*/
public function mainAction()
{
// TODO: Protect this controller with roles? It is also defined in security.yml
@ -22,6 +29,9 @@ class ForumController extends Controller
));
}
/**
* @Route("/{topicGroupSlug}", name="KekRozsakFrontBundle_forum_topic_list")
*/
public function topicListAction($topicGroupSlug)
{
$groupRepo = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:ForumTopicGroup');
@ -33,6 +43,9 @@ class ForumController extends Controller
));
}
/**
* @Route("/{topicGroupSlug}/{topicSlug}", name="KekRozsakFrontBundle_forum_post_list")
*/
public function postListAction($topicGroupSlug, $topicSlug)
{
$request = $this->getRequest();
@ -44,12 +57,12 @@ class ForumController extends Controller
// Get the topic based on slug
$topicRepo = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:ForumTopic');
if (!($topic = $topicRepo->findOneBy(array('topic_group' => $topicGroup, 'slug' => $topicSlug))))
if (!($topic = $topicRepo->findOneBy(array('topicGroup' => $topicGroup, 'slug' => $topicSlug))))
throw $this->createNotFoundException('A kért téma nem létezik!');
// Get the list of posts in the requested topic
$postRepo = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:ForumPost');
$posts = $postRepo->findBy(array('topic' => $topic), array('created_at' => 'DESC') /* TODO: , limit, offset */);
$posts = $postRepo->findBy(array('topic' => $topic), array('createdAt' => 'DESC') /* TODO: , limit, offset */);
// Create an empty post object for posting
$post = new ForumPost();

View File

@ -22,7 +22,7 @@ class KekRozsakFrontExtension extends Extension
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.xml');
}
}

View File

@ -4,294 +4,340 @@ namespace KekRozsak\FrontBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use KekRozsak\FrontBundle\Entity\User;
/**
* KekRozsak\FrontBundle\Entity\Article
* @ORM\Entity
* @ORM\Table(name="articles")
*/
class Article
{
/**
* @var integer $id
*/
private $id;
/**
* @var integer $id
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\Column(type="integer", name="id")
*/
private $id;
/**
* @var string $title
*/
private $title;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* @var string $slug
*/
private $slug;
/**
* @var string $title
* @ORM\Column(type="string", length=100, nullable=false)
*/
private $title;
/**
* @var text $text
*/
private $text;
/**
* Set title
*
* @param string $title
* @return Article
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* @var string $source
*/
private $source;
/**
* Get title
*
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* @var DateTime $created_at
*/
private $created_at;
/**
* @var string $slug
* @ORM\Column(type="string", length=100, nullable=false, unique=true)
*/
private $slug;
/**
* @var DateTime $updated_at
*/
private $updated_at;
/**
* Set slug
*
* @param string $slug
* @return Article
*/
public function setSlug($slug)
{
$this->slug = $slug;
return $this;
}
/**
* @var text $update_reason
*/
private $update_reason;
/**
* Get slug
*
* @return string
*/
public function getSlug()
{
return $this->slug;
}
/**
* @var KekRozsak\FrontBundle\Entity\User
*/
private $created_by;
/**
* @var text $text
* @ORM\Column(type="text", nullable=false)
*/
private $text;
/**
* @var KekRozsak\FrontBundle\Entity\User
*/
private $updated_by;
/**
* Set text
*
* @param text $text
* @return Article
*/
public function setText($text)
{
$this->text = $text;
return $this;
}
/**
* Get text
*
* @return text
*/
public function getText()
{
return $this->text;
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* @var string $source
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $source;
/**
* Set title
*
* @param string $title
* @return Article
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* Set source
*
* @param string $source
* @return Article
*/
public function setSource($source)
{
$this->source = $source;
return $this;
}
/**
* Get title
*
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* Get source
*
* @return string
*/
public function getSource()
{
return $this->source;
}
/**
* Set slug
*
* @param string $slug
* @return Article
*/
public function setSlug($slug)
{
$this->slug = $slug;
return $this;
}
/**
* @var DateTime $createdAt
* @ORM\Column(type="datetime", nullable=false, name="created_at")
*/
private $createdAt;
/**
* Get slug
*
* @return string
*/
public function getSlug()
{
return $this->slug;
}
/**
* Set createdAt
*
* @param DateTime $createdAt
* @return Article
*/
public function setCreatedAt(\DateTime $createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Set text
*
* @param text $text
* @return Article
*/
public function setText($text)
{
$this->text = $text;
return $this;
}
/**
* Get createdAt
*
* @return DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Get text
*
* @return text
*/
public function getText()
{
return $this->text;
}
/**
* @var User $createdBy
* @ORM\ManyToOne(targetEntity="User", inversedBy="articles")
* @ORM\JoinColumn(name="created_by_id", referencedColumnName="id")
*/
private $createdBy;
/**
* Set source
*
* @param string $source
* @return Article
*/
public function setSource($source)
{
$this->source = $source;
return $this;
}
/**
* Set createdBy
*
* @param User $createdBy
* @return Article
*/
public function setCreatedBy(User $createdBy = null)
{
$this->createdBy = $createdBy;
return $this;
}
/**
* Get source
*
* @return string
*/
public function getSource()
{
return $this->source;
}
/**
* Get createdBy
*
* @return User
*/
public function getCreatedBy()
{
return $this->createdBy;
}
/**
* Set created_at
*
* @param DateTime $createdAt
* @return Article
*/
public function setCreatedAt(\DateTime $createdAt)
{
$this->created_at = $createdAt;
return $this;
}
/**
* @var DateTime $updatedAt
* @ORM\Column(type="datetime", nullable=true, name="updated_at")
*/
private $updatedAt;
/**
* Get created_at
*
* @return DateTime
*/
public function getCreatedAt()
{
return $this->created_at;
}
/**
* Set updatedAt
*
* @param DateTime $updatedAt
* @return Article
*/
public function setUpdatedAt(\DateTime $updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Set updated_at
*
* @param DateTime $updatedAt
* @return Article
*/
public function setUpdatedAt(\DateTime $updatedAt)
{
$this->updated_at = $updatedAt;
return $this;
}
/**
* Get updatedAt
*
* @return DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* Get updated_at
*
* @return DateTime
*/
public function getUpdatedAt()
{
return $this->updated_at;
}
/**
* @var User $updatedBy
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="updated_by_id", referencedColumnName="id")
*/
private $updatedBy;
/**
* Set update_reason
*
* @param text $updateReason
* @return Article
*/
public function setUpdateReason($updateReason)
{
$this->update_reason = $updateReason;
return $this;
}
/**
* Set updatedBy
*
* @param User $updatedBy
* @return Article
*/
public function setUpdatedBy(User $updatedBy = null)
{
$this->updatedBy = $updatedBy;
return $this;
}
/**
* Get update_reason
*
* @return text
*/
public function getUpdateReason()
{
return $this->update_reason;
}
/**
* Get updatedBy
*
* @return User
*/
public function getUpdatedBy()
{
return $this->updatedBy;
}
/**
* Set created_by
*
* @param KekRozsak\FrontBundle\Entity\User $createdBy
* @return Article
*/
public function setCreatedBy(\KekRozsak\FrontBundle\Entity\User $createdBy = null)
{
$this->created_by = $createdBy;
return $this;
}
/**
* @var text $updateReason
* @ORM\Column(type="text", nullable=true, name="update_reason")
*/
private $updateReason;
/**
* Get created_by
*
* @return KekRozsak\FrontBundle\Entity\User
*/
public function getCreatedBy()
{
return $this->created_by;
}
/**
* Set updateReason
*
* @param text $updateReason
* @return Article
*/
public function setUpdateReason($updateReason)
{
$this->updateReason = $updateReason;
return $this;
}
/**
* Set updated_by
*
* @param KekRozsak\FrontBundle\Entity\User $updatedBy
* @return Article
*/
public function setUpdatedBy(\KekRozsak\FrontBundle\Entity\User $updatedBy = null)
{
$this->updated_by = $updatedBy;
return $this;
}
/**
* Get updateReason
*
* @return text
*/
public function getUpdateReason()
{
return $this->updateReason;
}
/**
* Get updated_by
*
* @return KekRozsak\FrontBundle\Entity\User
*/
public function getUpdatedBy()
{
return $this->updated_by;
}
/**
* @var boolean $main_page
*/
private $main_page;
/**
* @var boolean $mainPage
* @ORM\Column(type="boolean", name="main_page", nullable=true)
*/
private $mainPage;
/**
* Set mainPage
*
* @param boolean $mainPage
* @return Article
*/
public function setMainPage($mainPage)
{
$this->mainPage = $mainPage;
return $this;
}
/**
* Set main_page
*
* @param boolean $mainPage
* @return Article
*/
public function setMainPage($mainPage)
{
$this->main_page = $mainPage;
return $this;
}
/**
* Get mainPage
*
* @return boolean
*/
public function getMainPage()
{
return $this->mainPage;
}
/**
* Get main_page
*
* @return boolean
*/
public function getMainPage()
{
return $this->main_page;
}
/**
* @var boolean $public
* @ORM\Column(type="boolean", nullable=false)
*/
private $public;
/**
* Set public
*
* @param boolean $public
* @return Article
*/
public function setPublic($public)
{
$this->public = $public;
return $this;
}
/**
* Get public
*
* @return boolean
*/
public function getPublic()
{
return $this->public;
}
}

View File

@ -0,0 +1,286 @@
<?php
namespace KekRozsak\FrontBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use KekRozsak\FrontBundle\Entity\User;
/**
* KekRozsak\FrontBundle\Entity\Document
* @ORM\Entity
* @ORM\Table(name="documents")
*/
class Document
{
/**
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\Column(type="integer")
*/
private $id;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* @var string $title
* @ORM\Column(type="string", length=150, nullable=false, unique=true)
*/
private $title;
/**
* Set title
*
* @param string $title
* @return Document
*/
public function setTitle(string $title)
{
$this->title = $title;
return $this;
}
/**
* Get title
*
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* @var string $slug;
* @ORM\Column(type="string", length=150, nullable=false, unique=true)
*/
private $slug;
/**
* Set slug
*
* @param string $slug
* @return Document
*/
public function setSlug(string $slug)
{
$this->slug = $slug;
return $this;
}
/** Get slug
*
* @return string
*/
public function getSlug()
{
return $this->slug;
}
/**
* @var string $text
* @ORM\Column(type="text", nullable=false)
*/
private $text;
/**
* Set text
*
* @param string $text
* @return Document
*/
public function setText(string $text)
{
$this->text = $text;
return $this;
}
/**
* Get text
*
* @return string
*/
public function getText()
{
return $this->text;
}
/**
* @var DateTime $createdAt
* @ORM\Column(type="datetime", name="created_at", nullable=false)
*/
private $createdAt;
/**
* Set createdAt
*
* @param DateTime $createdAt
* @return Document
*/
public function setCreatedAt(\DateTime $createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt
*
* @return DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* @var User $createdBy
* @ORM\ManyToOne(targetEntity="User", inversedBy="createdDocuments")
* @ORM\JoinColumn(name="created_by_id", referencedColumnName="id")
*/
private $createdBy;
/**
* Set createdBy
*
* @param User $createdBy
* @return Document
*/
public function setCreatedBy(User $createdBy)
{
$this->createdBy = $createdBy;
return $this;
}
/**
* Get createdBy
*
* @return User
*/
public function getCreatedBy()
{
return $this->createdBy;
}
/**
* @var DateTime $updatedAt
* @ORM\Column(type="datetime", name="updated_at", nullable=true)
*/
private $updatedAt;
/**
* Set updatedAt
*
* @param DateTime $updatedAt
* @return Document
*/
public function setUpdatedAt(\DateTime $updatedAt = null)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Get updatedAt
*
* @return DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* @var User $updatedBy
* @ORM\ManyToOne(targetEntity="User", inversedBy="updatedDocuments")
* @ORM\JoinColumn(name="updated_by_id", referencedColumnName="id")
*/
private $updatedBy;
/**
* Set updatedBy
*
* @param User $updatedBy
* @return Document
*/
public function setUpdatedBy(User $updatedBy = null)
{
$this->updatedBy = $updatedBy;
return $this;
}
/**
* Get updatedBy
*
* @return User
*/
public function getUpdatedBy()
{
return $this->updatedBy;
}
/**
* @var string $updateReason
* @ORM\Column(name="update_reason", type="text", nullable=true)
*/
private $updateReason;
/**
* Set updateReason
*
* @param string $updateReason
* @return Document
*/
public function setUpdateReason(string $updateReason = null)
{
$this->updateReason = $updateReason;
return $this;
}
/**
* Get updateReason
*
* @return string
*/
public function getUpdateReason()
{
return $this->updateReason;
}
/**
* @var Group $groups
* @ORM\ManyToMany(targetEntity="Group", mappedBy="documents", fetch="EXTRA_LAZY")
*/
private $groups;
/**
* Set groups
*
* @param Group $groups
* @return Document
*/
public function setGroups(Group $groups = null)
{
$this->groups = $groups;
return $this;
}
/**
* Get groups
*
* @return Group
*/
public function getGroups()
{
return $this->groups;
}
}

View File

@ -4,217 +4,232 @@ namespace KekRozsak\FrontBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use KekRozsak\FrontBundle\Entity\User;
use KekRozsak\FrontBundle\Entity\ForumTopic;
use KekRozsak\FrontBundle\Entity\ForumTopicGroup;
/**
* KekRozsak\FrontBundle\Entity\ForumPost
* @ORM\Entity
* @ORM\Table(name="forum_posts")
*/
class ForumPost
{
/**
* @var integer $id
*/
private $id;
/**
* @var integer $id
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\Column(type="integer")
*/
private $id;
/**
* @var datetime $created_at
*/
private $created_at;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* @var datetime $updated_at
*/
private $updated_at;
/**
* @var datetime $createdAt
* @ORM\Column(type="datetime", name="created_at", nullable=false)
*/
private $createdAt;
/**
* @var string $update_reason
*/
private $update_reason;
/**
* Set createdAt
*
* @param DateTime $createdAt
* @return ForumPost
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* @var text $text
*/
private $text;
/**
* Get createdAt
*
* @return DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* @var KekRozsak\FrontBundle\Entity\User
*/
private $created_by;
/**
* @var User $createdBy
* @ORM\ManyToOne(targetEntity="User", inversedBy="forumPosts")
* @ORM\JoinColumn(name="created_by_id", referencedColumnName="id")
*/
private $createdBy;
/**
* @var KekRozsak\FrontBundle\Entity\User
*/
private $updated_by;
/**
* Set createdBy
*
* @param User $createdBy
* @return ForumPost
*/
public function setCreatedBy(User $createdBy)
{
$this->createdBy = $createdBy;
return $this;
}
/**
* @var KekRozsak\FrontBundle\Entity\ForumTopic
*/
private $topic;
/**
* Get createdBy
*
* @return User
*/
public function getCreatedBy()
{
return $this->createdBy;
}
/**
* @var datetime $updatedAt
* @ORM\Column(type="datetime", name="updated_at", nullable=true)
*/
private $updatedAt;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set updatedAt
*
* @param DateTime $updatedAt
* @return ForumPost
*/
public function setUpdatedAt(\DateTime $updatedAt = null)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Set created_at
*
* @param datetime $createdAt
* @return ForumPost
*/
public function setCreatedAt($createdAt)
{
$this->created_at = $createdAt;
return $this;
}
/**
* Get updatedAt
*
* @return DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* Get created_at
*
* @return datetime
*/
public function getCreatedAt()
{
return $this->created_at;
}
/**
* @var User $updatedBy
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="updated_by_id", referencedColumnName="id")
*/
private $updatedBy;
/**
* Set updated_at
*
* @param datetime $updatedAt
* @return ForumPost
*/
public function setUpdatedAt($updatedAt)
{
$this->updated_at = $updatedAt;
return $this;
}
/**
* Set updatedBy
*
* @param User $updatedBy
* @return ForumPost
*/
public function setUpdatedBy(User $updatedBy = null)
{
$this->updatedBy = $updatedBy;
return $this;
}
/**
* Get updated_at
*
* @return datetime
*/
public function getUpdatedAt()
{
return $this->updated_at;
}
/**
* Get updatedBy
*
* @return User
*/
public function getUpdatedBy()
{
return $this->updatedBy;
}
/**
* Set update_reason
*
* @param string $updateReason
* @return ForumPost
*/
public function setUpdateReason($updateReason)
{
$this->update_reason = $updateReason;
return $this;
}
/**
* @var string $updateReason
* @ORM\Column(type="text", name="update_reason", nullable=true)
*/
private $updateReason;
/**
* Get update_reason
*
* @return string
*/
public function getUpdateReason()
{
return $this->update_reason;
}
/**
* Set updateReason
*
* @param string $updateReason
* @return ForumPost
*/
public function setUpdateReason($updateReason = null)
{
$this->updateReason = $updateReason;
return $this;
}
/**
* Set text
*
* @param text $text
* @return ForumPost
*/
public function setText($text)
{
$this->text = $text;
return $this;
}
/**
* Get updateReason
*
* @return string
*/
public function getUpdateReason()
{
return $this->updateReason;
}
/**
* Get text
*
* @return text
*/
public function getText()
{
return $this->text;
}
/**
* @var ForumTopic $topic
* @ORM\ManyToOne(targetEntity="ForumTopic", inversedBy="posts")
*/
private $topic;
/**
* 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;
}
/**
* Set topic
*
* @param ForumTopic $topic
* @return ForumPost
*/
public function setTopic(ForumTopic $topic)
{
$this->topic = $topic;
if (($this->topic->getLastPost() === null) || ($this->topic->getLastPost()->getCreatedAt() > $this->createdAt))
$topic->setLastPost($this);
return $this;
}
/**
* Get created_by
*
* @return KekRozsak\FrontBundle\Entity\User
*/
public function getCreatedBy()
{
return $this->created_by;
}
/**
* Get topic
*
* @return ForumTopic
*/
public function getTopic()
{
return $this->topic;
}
/**
* 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;
}
/**
* @var text $text
* @ORM\Column(type="text", nullable=false)
*/
private $text;
/**
* Get updated_by
*
* @return KekRozsak\FrontBundle\Entity\User
*/
public function getUpdatedBy()
{
return $this->updated_by;
}
/**
* Set text
*
* @param string $text
* @return ForumPost
*/
public function setText($text)
{
$this->text = $text;
return $this;
}
/**
* Set topic
*
* @param ForumTopic $topic
* @return ForumPost
*/
public function setTopic(ForumTopic $topic)
{
$this->topic = $topic;
$topic->setLastPost($this);
return $this;
}
/**
* Get topic
*
* @return KekRozsak\FrontBundle\Entity\ForumTopic
*/
public function getTopic()
{
return $this->topic;
}
/**
* Get text
*
* @return string
*/
public function getText()
{
return $this->text;
}
}

View File

@ -4,305 +4,321 @@ namespace KekRozsak\FrontBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use KekRozsak\FrontBundle\Entity\User;
use KekRozsak\FrontBundle\Entity\ForumTopicGroup;
use KekRozsak\FrontBundle\Entity\ForumPost;
/**
* KekRozsak\FrontBundle\Entity\ForumTopic
* @ORM\Entity
* @ORM\Table(name="forum_topics", uniqueConstraints={@ORM\UniqueConstraint(columns={"topic_group_id", "title"}), @ORM\UniqueConstraint(columns={"topic_group_id", "slug"})})
*/
class ForumTopic
{
/**
* @var integer $id
*/
private $id;
public function __construct()
{
$this->posts = 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)
*/
private $title;
/**
* @var datetime $updated_at
*/
private $updated_at;
/**
* Set title
*
* @param string $title
* @return ForumTopic
*/
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)
*/
private $slug;
/**
* @var KekRozsak\FrontBundle\Entity\User
*/
private $updated_by;
/**
* Set slug
*
* @param string $slug
* @return ForumTopic
*/
public function setSlug($slug)
{
$this->slug = $slug;
return $this;
}
/**
* @var KekRozsak\FrontBundle\Entity\ForumTopicGroup
*/
private $topic_group;
/**
* Get slug
*
* @return string
*/
public function getSlug()
{
return $this->slug;
}
/**
* @var datetime $createdAt
* @ORM\Column(type="datetime", name="created_at")
*/
private $createdAt;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set createdAt
*
* @param DateTime $createdAt
* @return ForumTopic
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Set title
*
* @param string $title
* @return ForumTopic
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* Get createdAt
*
* @return DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Get title
*
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* @var User
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="created_by_id")
*/
private $createdBy;
/**
* Set slug
*
* @param string $slug
* @return ForumTopic
*/
public function setSlug($slug)
{
$this->slug = $slug;
return $this;
}
/**
* Set createdBy
*
* @param User $createdBy
* @return ForumTopic
*/
public function setCreatedBy(\User $createdBy)
{
$this->createdBy = $createdBy;
return $this;
}
/**
* Get slug
*
* @return string
*/
public function getSlug()
{
return $this->slug;
}
/**
* Get createdBy
*
* @return User
*/
public function getCreatedBy()
{
return $this->createdBy;
}
/**
* Set created_at
*
* @param datetime $createdAt
* @return ForumTopic
*/
public function setCreatedAt($createdAt)
{
$this->created_at = $createdAt;
return $this;
}
/**
* @var datetime $updatedAt
* @ORM\Column(type="datetime", name="updated_at", nullable=true)
*/
private $updatedAt;
/**
* Get created_at
*
* @return datetime
*/
public function getCreatedAt()
{
return $this->created_at;
}
/**
* Set updatedAt
*
* @param datetime $updatedAt
* @return ForumTopic
*/
public function setUpdatedAt(\DateTime $updatedAt = null)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Set updated_at
*
* @param datetime $updatedAt
* @return ForumTopic
*/
public function setUpdatedAt($updatedAt)
{
$this->updated_at = $updatedAt;
return $this;
}
/**
* Get updatedAt
*
* @return datetime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* Get updated_at
*
* @return datetime
*/
public function getUpdatedAt()
{
return $this->updated_at;
}
/**
* @var User
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="updated_by_id")
*/
private $updatedBy;
/**
* Set update_reason
*
* @param text $updateReason
* @return ForumTopic
*/
public function setUpdateReason($updateReason)
{
$this->update_reason = $updateReason;
return $this;
}
/**
* Set updatedBy
*
* @param User $updatedBy
* @return ForumTopic
*/
public function setUpdatedBy(User $updatedBy = null)
{
$this->updatedBy = $updatedBy;
return $this;
}
/**
* Get update_reason
*
* @return text
*/
public function getUpdateReason()
{
return $this->update_reason;
}
/**
* Get updatedBy
*
* @return User
*/
public function getUpdatedBy()
{
return $this->updatedBy;
}
/**
* Set created_by
*
* @param KekRozsak\FrontBundle\Entity\User $createdBy
* @return ForumTopic
*/
public function setCreatedBy(\KekRozsak\FrontBundle\Entity\User $createdBy = null)
{
$this->created_by = $createdBy;
return $this;
}
/**
* @var text $updateReason
* @ORM\Column(type="text", name="update_reason")
*/
private $updateReason;
/**
* Get created_by
*
* @return KekRozsak\FrontBundle\Entity\User
*/
public function getCreatedBy()
{
return $this->created_by;
}
/**
* Set updateReason
*
* @param text $updateReason
* @return ForumTopic
*/
public function setUpdateReason($updateReason)
{
$this->updateReason = $updateReason;
return $this;
}
/**
* Set updated_by
*
* @param KekRozsak\FrontBundle\Entity\User $updatedBy
* @return ForumTopic
*/
public function setUpdatedBy(\KekRozsak\FrontBundle\Entity\User $updatedBy = null)
{
$this->updated_by = $updatedBy;
return $this;
}
/**
* Get updateReason
*
* @return text
*/
public function getUpdateReason()
{
return $this->updateReason;
}
/**
* Get updated_by
*
* @return KekRozsak\FrontBundle\Entity\User
*/
public function getUpdatedBy()
{
return $this->updated_by;
}
/**
* @var ForumTopicGroup
* @ORM\ManyToOne(targetEntity="ForumTopicGroup")
* @ORM\JoinColumn(name="topic_group_id", referencedColumnName="id")
*/
private $topicGroup;
/**
* Set topic_group
*
* @param KekRozsak\FrontBundle\Entity\ForumTopicGroup $topicGroup
* @return ForumTopic
*/
public function setTopicGroup(\KekRozsak\FrontBundle\Entity\ForumTopicGroup $topicGroup = null)
{
$this->topic_group = $topicGroup;
return $this;
}
/**
* Set topicGroup
*
* @param ForumTopicGroup $topicGroup
* @return ForumTopic
*/
public function setTopicGroup(ForumTopicGroup $topicGroup)
{
$this->topicGroup = $topicGroup;
return $this;
}
/**
* Get topic_group
*
* @return KekRozsak\FrontBundle\Entity\ForumTopicGroup
*/
public function getTopicGroup()
{
return $this->topic_group;
}
/**
* @var \Doctrine\Common\Collections\ArrayCollection
*/
private $posts;
/**
* Get topicGroup
*
* @return ForumTopicGroup
*/
public function getTopicGroup()
{
return $this->topicGroup;
}
/**
* @var \Doctrine\Common\Collections\ArrayCollection
* @ORM\OneToMany(targetEntity="ForumPost", mappedBy="topic")
*/
private $posts;
public function __construct()
{
$this->posts = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Add posts
*
* @param ForumPost $posts
* @return ForumTopic
*/
public function addForumPost(ForumPost $posts)
{
$this->posts[] = $posts;
return $this;
}
/**
* 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;
}
/**
* Get posts
*
* @return Doctrine\Common\Collections\Collection
*/
public function getPosts()
{
return $this->posts;
}
/**
* @var KekRozsak\FrontBundle\Entity\ForumPost
*/
private $lastPost;
/**
* Set lastPost
*
* @param KekRozsak\FrontBundle\Entity\ForumPost $lastPost
* @return ForumTopic
*/
public function setLastPost(\KekRozsak\FrontBundle\Entity\ForumPost $lastPost)
{
$this->lastPost = $lastPost;
$this->topic_group->setLastPost($lastPost);
return $this;
}
/**
* Get lastPost
*
* @return KekRozsak\FrontBundle\Entity\ForumPost
*/
public function getLastPost()
{
return $this->lastPost;
}
/**
* @var KekRozsak\FrontBundle\Entity\ForumPost
*/
private $last_post;
/**
* @var ForumPost
* @ORM\OneToOne(targetEntity="ForumPost", cascade={"persist"})
* @ORM\JoinColumn(name="last_post_id", referencedColumnName="id")
*/
private $lastPost;
/**
* Set lastPost
*
* @param ForumPost $lastPost
* @return ForumTopic
*/
public function setLastPost(ForumPost $lastPost = null)
{
$this->lastPost = $lastPost;
$this->topicGroup->setLastPost($lastPost);
return $this;
}
/**
* Get lastPost
*
* @return ForumPost
*/
public function getLastPost()
{
return $this->lastPost;
}
}

View File

@ -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();
}
/**
* @var ForumPost
* @ORM\OneToOne(targetEntity="ForumPost", cascade={"persist"})
* @ORM\JoinColumn(name="last_post_id")
*/
private $lastPost;
/**
* Add topic
*
* @param KekRozsak\FrontBundle\Entity\ForumTopic $topic
* @return ForumTopicGroup
*/
public function addForumTopic(\KekRozsak\FrontBundle\Entity\ForumTopic $topic)
{
$this->topic[] = $topic;
return $this;
}
/**
* Set lastPost
*
* @param ForumPost $lastPost
* @return ForumTopicGroup
*/
public function setLastPost(ForumPost $lastPost = null)
{
$this->lastPost = $lastPost;
return $this;
}
/**
* Get topic
*
* @return Doctrine\Common\Collections\Collection
*/
public function getTopic()
{
return $this->topic;
}
/**
* @var \Doctrine\Common\Collections\ArrayCollection
*/
private $topics;
/**
* Get topics
*
* @return Doctrine\Common\Collections\Collection
*/
public function getTopics()
{
return $this->topics;
}
/**
* @var KekRozsak\FrontBundle\Entity\ForumPost
*/
private $lastPost;
/**
* 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 lastPost
*
* @return ForumPost
*/
public function getLastPost()
{
return $this->lastPost;
}
/**
* @var \Doctrine\Common\Collections\ArrayCollection
* @ORM\OneToMany(targetEntity="ForumTopic", mappedBy="topicGroup")
*/
private $topics;
/**
* Get topics
*
* @return Doctrine\Common\Collections\Collection
*/
public function getTopics()
{
return $this->topics;
}
}

View File

@ -0,0 +1,261 @@
<?php
namespace KekRozsak\FrontBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* KekRozsak\FrontBundle\Entity\Group
* @ORM\Entity
* @ORM\Table(name="groups")
*/
class Group
{
/**
* @var integer $id
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\Column(type="integer")
*/
private $id;
/**
* @var string $name
* @ORM\Column(type="string", length=50, nullable=false, unique=true)
*/
private $name;
/**
* @var string $slug
* @ORM\Column(type="string", length=50, nullable=false, unique=true)
*/
private $slug;
/**
* @var datetime $createdAt
* @ORM\Column(type="datetime", name="created_at", nullable=false)
*/
private $createdAt;
/**
* @var datetime $updatedAt
* @ORM\Column(type="datetime", name="updated_at", nullable=true)
*/
private $updatedAt;
/**
* @var text $updateReason
* @ORM\Column(type="text", name="update_reason", nullable=true)
*/
private $updateReason;
/**
* @var KekRozsak\FrontBundle\Entity\User $createdBy
* @ORM\ManyToOne(targetEntity="User")
*/
private $createdBy;
/**
* @var KekRozsak\FrontBundle\Entity\User $updatedBy
* @ORM\ManyToOne(targetEntity="User")
*/
private $updatedBy;
/**
* @var KekRozsak\FrontBundle\Entity\User $leader
* @ORM\ManyToOne(targetEntity="User", inversedBy="ledGroups")
*/
private $leader;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set name
*
* @param string $name
* @return Group
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set slug
*
* @param string $slug
* @return Group
*/
public function setSlug($slug)
{
$this->slug = $slug;
return $this;
}
/**
* Get slug
*
* @return string
*/
public function getSlug()
{
return $this->slug;
}
/**
* Set createdAt
*
* @param datetime $createdAt
* @return Group
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt
*
* @return datetime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Set updatedAt
*
* @param datetime $updatedAt
* @return Group
*/
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Get updatedAt
*
* @return datetime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* Set updateReason
*
* @param text $updateReason
* @return Group
*/
public function setUpdateReason($updateReason)
{
$this->updateReason = $updateReason;
return $this;
}
/**
* Get updateReason
*
* @return text
*/
public function getUpdateReason()
{
return $this->updateReason;
}
/**
* Set createdBy
*
* @param KekRozsak\FrontBundle\Entity\User $createdBy
* @return Group
*/
public function setCreatedBy(\KekRozsak\FrontBundle\Entity\User $createdBy = null)
{
$this->createdBy = $createdBy;
return $this;
}
/**
* Get createdBy
*
* @return KekRozsak\FrontBundle\Entity\User
*/
public function getCreatedBy()
{
return $this->createdBy;
}
/**
* Set updatedBy
*
* @param KekRozsak\FrontBundle\Entity\User $updatedBy
* @return Group
*/
public function setUpdatedBy(\KekRozsak\FrontBundle\Entity\User $updatedBy = null)
{
$this->updatedBy = $updatedBy;
return $this;
}
/**
* Get updatedBy
*
* @return KekRozsak\FrontBundle\Entity\User
*/
public function getUpdatedBy()
{
return $this->updatedBy;
}
/**
* Set leader
*
* @param KekRozsak\FrontBundle\Entity\User $leader
* @return Group
*/
public function setLeader(\KekRozsak\FrontBundle\Entity\User $leader = null)
{
$this->leader = $leader;
return $this;
}
/**
* Get leader
*
* @return KekRozsak\FrontBundle\Entity\User
*/
public function getLeader()
{
return $this->leader;
}
/**
* @var ArrayCollection $documents
* @ORM\ManyToMany(targetEntity="Document", inversedBy="groups")
*/
private $documents;
}

View File

@ -6,238 +6,252 @@ use Doctrine\ORM\Mapping as ORM;
/**
* KekRozsak\FrontBundle\Entity\News
* @ORM\Entity
* @ORM\Table(name="news")
*/
class News
{
/**
* @var integer $id
*/
private $id;
/**
* @var integer $id
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\Column(type="integer", name="id")
*/
private $id;
/**
* @var datetime $created_at
*/
private $created_at;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* @var datetime $updated_at
*/
private $updated_at;
/**
* @var datetime $createdAt
* @ORM\Column(type="datetime", name="created_at")
*/
private $createdAt;
/**
* @var text $update_reason
*/
private $update_reason;
/**
* Set createdAt
*
* @param datetime $createdAt
* @return News
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* @var string $title
*/
private $title;
/**
* Get createdAt
*
* @return datetime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* @var string $slug
*/
private $slug;
/**
* @var datetime $updatedAt
* @ORM\Column(type="datetime", name="updated_at", nullable=true)
*/
private $updatedAt;
/**
* @var text $text
*/
private $text;
/**
* @var text $updateReason
* @ORM\Column(type="text", name="update_reason", nullable=true)
*/
private $updateReason;
/**
* @var KekRozsak\FrontBundle\Entity\User
*/
private $created_by;
/**
* @var string $title
* @ORM\Column(type="string", length=100, nullable=false)
*/
private $title;
/**
* @var KekRozsak\FrontBundle\Entity\User
*/
private $updated_by;
/**
* @var string $slug
* @ORM\Column(type="string", length=100, nullable=false, unique=true)
*/
private $slug;
/**
* @var text $text
* @ORM\Column(type="text", nullable=true)
*/
private $text;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* @var KekRozsak\FrontBundle\Entity\User $createdBy
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="created_by_id", referencedColumnName="id")
*/
private $createdBy;
/**
* Set created_at
*
* @param datetime $createdAt
* @return News
*/
public function setCreatedAt($createdAt)
{
$this->created_at = $createdAt;
return $this;
}
/**
* @var KekRozsak\FrontBundle\Entity\User $updatedBy
* @ORM\ManyToOne(targetEntity="User", fetch="EXTRA_LAZY")
* @ORM\JoinColumn(name="updated_by_id", referencedColumnName="id")
*/
private $updatedBy;
/**
* Get created_at
*
* @return datetime
*/
public function getCreatedAt()
{
return $this->created_at;
}
/**
* Set updatedAt
*
* @param datetime $updatedAt
* @return News
*/
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Set updated_at
*
* @param datetime $updatedAt
* @return News
*/
public function setUpdatedAt($updatedAt)
{
$this->updated_at = $updatedAt;
return $this;
}
/**
* Get updatedAt
*
* @return datetime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* Get updated_at
*
* @return datetime
*/
public function getUpdatedAt()
{
return $this->updated_at;
}
/**
* Set updateReason
*
* @param text $updateReason
* @return News
*/
public function setUpdateReason($updateReason)
{
$this->updateReason = $updateReason;
return $this;
}
/**
* Set update_reason
*
* @param text $updateReason
* @return News
*/
public function setUpdateReason($updateReason)
{
$this->update_reason = $updateReason;
return $this;
}
/**
* Get updateReason
*
* @return text
*/
public function getUpdateReason()
{
return $this->updateReason;
}
/**
* Get update_reason
*
* @return text
*/
public function getUpdateReason()
{
return $this->update_reason;
}
/**
* Set title
*
* @param string $title
* @return News
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* Set title
*
* @param string $title
* @return News
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* Get title
*
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* Get title
*
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* Set slug
*
* @param string $slug
* @return News
*/
public function setSlug($slug)
{
$this->slug = $slug;
return $this;
}
/**
* Set slug
*
* @param string $slug
* @return News
*/
public function setSlug($slug)
{
$this->slug = $slug;
return $this;
}
/**
* Get slug
*
* @return string
*/
public function getSlug()
{
return $this->slug;
}
/**
* Get slug
*
* @return string
*/
public function getSlug()
{
return $this->slug;
}
/**
* Set text
*
* @param text $text
* @return News
*/
public function setText($text)
{
$this->text = $text;
return $this;
}
/**
* Set text
*
* @param text $text
* @return News
*/
public function setText($text)
{
$this->text = $text;
return $this;
}
/**
* Get text
*
* @return text
*/
public function getText()
{
return $this->text;
}
/**
* Get text
*
* @return text
*/
public function getText()
{
return $this->text;
}
/**
* Set createdBy
*
* @param KekRozsak\FrontBundle\Entity\User $createdBy
* @return News
*/
public function setCreatedBy(\KekRozsak\FrontBundle\Entity\User $createdBy = null)
{
$this->createdBy = $createdBy;
return $this;
}
/**
* Set created_by
*
* @param KekRozsak\FrontBundle\Entity\User $createdBy
* @return News
*/
public function setCreatedBy(\KekRozsak\FrontBundle\Entity\User $createdBy = null)
{
$this->created_by = $createdBy;
return $this;
}
/**
* Get createdBy
*
* @return KekRozsak\FrontBundle\Entity\User
*/
public function getCreatedBy()
{
return $this->createdBy;
}
/**
* Get created_by
*
* @return KekRozsak\FrontBundle\Entity\User
*/
public function getCreatedBy()
{
return $this->created_by;
}
/**
* Set updatedBy
*
* @param KekRozsak\FrontBundle\Entity\User $updatedBy
* @return News
*/
public function setUpdatedBy(\KekRozsak\FrontBundle\Entity\User $updatedBy = null)
{
$this->updatedBy = $updatedBy;
return $this;
}
/**
* Set updated_by
*
* @param KekRozsak\FrontBundle\Entity\User $updatedBy
* @return News
*/
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;
}
/**
* Get updatedBy
*
* @return KekRozsak\FrontBundle\Entity\User
*/
public function getUpdatedBy()
{
return $this->updatedBy;
}
}

View File

@ -0,0 +1,292 @@
<?php
namespace KekRozsak\FrontBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use KekRozsak\FrontBundle\Entity\User;
/**
* KekRozsak\FrontBundle\Entity\Poll
* @ORM\Entity
* @ORM\Table(name="polls")
*/
class Poll
{
/**
* @var integer $id
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\Column(type="integer")
*/
private $id;
/**
* @var DateTime $createdAt
* @ORM\Column(type="datetime", nullable=false, name="created_at")
*/
private $createdAt;
/**
* @var DateTime $updatedAt
* @ORM\Column(type="datetime", name="updated_at")
*/
private $updatedAt;
/**
* @var text $updateReason
* @ORM\Column(type="text", name="update_reason")
*/
private $updateReason;
/**
* @var DateTime $pollEnd
* @ORM\Column(type="datetime", nullable=false, name="poll_end")
*/
private $pollEnd;
/**
* @var \Doctrine\Common\Collections\ArrayCollection
* @ORM\OneToMany(targetEntity="PollAnswer", mappedBy="answers")
*/
private $answers;
/**
* @var KekRozsak\FrontBundle\Entity\User
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="created_by_id", referencedColumnName="id")
*/
private $createdBy;
/**
* @var KekRozsak\FrontBundle\Entity\User
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="updated_by_id", referencedColumnName="id")
*/
private $updatedBy;
public function __construct()
{
$this->answers = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set createdAt
*
* @param datetime $createdAt
* @return Poll
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt
*
* @return datetime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Set updatedAt
*
* @param datetime $updatedAt
* @return Poll
*/
public function setUpdatedAt($updatedAt = null)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Get updatedAt
*
* @return datetime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* Set updateReason
*
* @param text $updateReason
* @return Poll
*/
public function setUpdateReason($updateReason = null)
{
$this->updateReason = $updateReason;
return $this;
}
/**
* Get updateReason
*
* @return text
*/
public function getUpdateReason()
{
return $this->updateReason;
}
/**
* Set pollEnd
*
* @param datetime $pollEnd
* @return Poll
*/
public function setPollEnd($pollEnd = null)
{
$this->pollEnd = $pollEnd;
return $this;
}
/**
* Get pollEnd
*
* @return datetime
*/
public function getPollEnd()
{
return $this->pollEnd;
}
/**
* Add answers
*
* @param KekRozsak\FrontBundle\Entity\PollAnswer $answers
* @return Poll
*/
public function addPollAnswer(\KekRozsak\FrontBundle\Entity\PollAnswer $answers)
{
$this->answers[] = $answers;
return $this;
}
/**
* Get answers
*
* @return Doctrine\Common\Collections\Collection
*/
public function getAnswers()
{
return $this->answers;
}
/**
* Set createdBy
*
* @param KekRozsak\FrontBundle\Entity\User $createdBy
* @return Poll
*/
public function setCreatedBy(\KekRozsak\FrontBundle\Entity\User $createdBy)
{
$this->createdBy = $createdBy;
return $this;
}
/**
* Get createdBy
*
* @return KekRozsak\FrontBundle\Entity\User
*/
public function getCreatedBy()
{
return $this->createdBy;
}
/**
* Set updatedBy
*
* @param KekRozsak\FrontBundle\Entity\User $updatedBy
* @return Poll
*/
public function setUpdatedBy(\KekRozsak\FrontBundle\Entity\User $updatedBy = null)
{
$this->updatedBy = $updatedBy;
return $this;
}
/**
* Get updatedBy
*
* @return KekRozsak\FrontBundle\Entity\User
*/
public function getUpdatedBy()
{
return $this->updatedBy;
}
/**
* @var text $text
* @ORM\Column(type="text", nullable=false)
*/
private $text;
/**
* @var boolean $anyoneCanAddAnswers
* @ORM\Column(type="boolean", nullable=false)
*/
private $anyoneCanAddAnswers;
/**
* Set text
*
* @param text $text
* @return Poll
*/
public function setText($text)
{
$this->text = $text;
return $this;
}
/**
* Get text
*
* @return text
*/
public function getText()
{
return $this->text;
}
/**
* Set anyoneCanAddAnswers
*
* @param boolean $anyoneCanAddAnswers
* @return Poll
*/
public function setAnyoneCanAddAnswers($anyoneCanAddAnswers)
{
$this->anyoneCanAddAnswers = $anyoneCanAddAnswers;
return $this;
}
/**
* Get anyoneCanAddAnswers
*
* @return boolean
*/
public function getAnyoneCanAddAnswers()
{
return $this->anyoneCanAddAnswers;
}
}

View File

@ -0,0 +1,265 @@
<?php
namespace KekRozsak\FrontBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use KekRozsak\FrontBundle\Entity\User;
use KekRozsak\FrontBundle\Entity\Poll;
/**
* KekRozsak\FrontBundle\Entity\PollAnswer
* @ORM\Entity
* @ORM\Table(name="poll_answers")
*/
class PollAnswer
{
/**
* @var integer $id
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\Column(type="integer")
*/
private $id;
/**
* @var DateTime $createdAt
* @ORM\Column(name="created_at", type="datetime")
*/
private $createdAt;
/**
* @var DateTime $updatedAt
* @ORM\Column(name="updated_at", type="datetime")
*/
private $updatedAt;
/**
* @var text $updateReason
* @ORM\Column(type="text", name="update_reason", nullable=true)
*/
private $updateReason;
/**
* @var \Doctrine\Common\Collections\ArrayCollection
* @ORM\ManyToMany(targetEntity="User", inversedBy="pollVotes")
*/
private $voters;
/**
* @var User
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="created_by_id")
*/
private $createdBy;
/**
* @var User
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="updated_by_id")
*/
private $updatedBy;
/**
* @var poll
* @ORM\ManyToOne(targetEntity="Poll", inversedBy="answers")
*/
private $poll;
public function __construct()
{
$this->voters = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set createdAt
*
* @param datetime $createdAt
* @return PollAnswer
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt
*
* @return datetime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Set updatedAt
*
* @param datetime $updatedAt
* @return PollAnswer
*/
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Get updatedAt
*
* @return datetime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* Set updateReason
*
* @param text $updateReason
* @return PollAnswer
*/
public function setUpdateReason($updateReason)
{
$this->updateReason = $updateReason;
return $this;
}
/**
* Get updateReason
*
* @return text
*/
public function getUpdateReason()
{
return $this->updateReason;
}
/**
* Add voters
*
* @param User $voters
* @return PollAnswer
*/
public function addVoters(User $voters)
{
$this->voters[] = $voters;
return $this;
}
/**
* Get voters
*
* @return Doctrine\Common\Collections\Collection
*/
public function getVoters()
{
return $this->voters;
}
/**
* Set createdBy
*
* @param User $createdBy
* @return PollAnswer
*/
public function setCreatedBy(User $createdBy = null)
{
$this->createdBy = $createdBy;
return $this;
}
/**
* Get createdBy
*
* @return User
*/
public function getCreatedBy()
{
return $this->createdBy;
}
/**
* Set updatedBy
*
* @param User $updatedBy
* @return PollAnswer
*/
public function setUpdatedBy(User $updatedBy = null)
{
$this->updatedBy = $updatedBy;
return $this;
}
/**
* Get updatedBy
*
* @return User
*/
public function getUpdatedBy()
{
return $this->updatedBy;
}
/**
* Set poll
*
* @param Poll $poll
* @return PollAnswer
*/
public function setPoll(Poll $poll = null)
{
$this->poll = $poll;
return $this;
}
/**
* Get poll
*
* @return Poll
*/
public function getPoll()
{
return $this->poll;
}
/**
* @var string $text
* @ORM\Column(type="text", nullable=false)
*/
private $text;
/**
* Set text
*
* @param string $text
* @return PollAnswer
*/
public function setText($text)
{
$this->text = $text;
return $this;
}
/**
* Get text
*
* @return string
*/
public function getText()
{
return $this->text;
}
}

View File

@ -1,145 +0,0 @@
<?php
namespace KekRozsak\FrontBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\Role\RoleInterface;
/**
* KekRozsak\FrontBundle\Entity\Role
*/
class Role implements RoleInterface
{
/**
* @var integer $id
*/
private $id;
/**
* @var string $name
*/
private $name;
/**
* @var string $display_name
*/
private $display_name;
/**
* @var boolean $can_be_assigned
*/
private $can_be_assigned;
/**
* @var \Doctrine\Common\Collections\ArrayCollection
*/
private $included_roles;
public function __construct()
{
$this->included_roles = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set name
*
* @param string $name
* @return Role
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set display_name
*
* @param string $displayName
* @return Role
*/
public function setDisplayName($displayName)
{
$this->display_name = $displayName;
return $this;
}
/**
* Get display_name
*
* @return string
*/
public function getDisplayName()
{
return $this->display_name;
}
/**
* Set can_be_assigned
*
* @param boolean $canBeAssigned
* @return Role
*/
public function setCanBeAssigned($canBeAssigned)
{
$this->can_be_assigned = $canBeAssigned;
return $this;
}
/**
* Get can_be_assigned
*
* @return boolean
*/
public function getCanBeAssigned()
{
return $this->can_be_assigned;
}
/**
* Add included_roles
*
* @param KekRozsak\FrontBundle\Entity\Role $includedRoles
* @return Role
*/
public function addRole(\KekRozsak\FrontBundle\Entity\Role $includedRoles)
{
$this->included_roles[] = $includedRoles;
return $this;
}
/**
* Get included_roles
*
* @return Doctrine\Common\Collections\Collection
*/
public function getIncludedRoles()
{
return $this->included_roles;
}
public function getRole()
{
return $this->name;
}
}

View File

@ -5,360 +5,484 @@ namespace KekRozsak\FrontBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Core\User\AdvancedUserInterface;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints as DoctrineAssert;
use KekRozsak\FrontBundle\Entity\Article;
use KekRozsak\FrontBundle\Entity\ForumPost;
use KekRozsak\FrontBundle\Entity\Group;
use KekRozsak\FrontBundle\Entity\Document;
use KekRozsak\FrontBundle\Entity\UserData;
use KekRozsak\FrontBundle\Entity\PollAnswer;
/**
* KekRozsak\FrontBundle\Entity\User
* @ORM\Entity
* @ORM\Table(name="users")
* @DoctrineAssert\UniqueEntity(fields={"username"}, message="Ez a felhasználónév már foglalt. Kérlek, válassz egy másikat!", groups={"registration"})
* @DoctrineAssert\UniqueEntity(fields={"email"}, message="Ez az e-mail cím már foglalt. Kérlek, válassz egy másikat!", groups={"registration"})
* @DoctrineAssert\UniqueEntity(fields={"displayName"}, message="Ez a név már foglalt. Kérlek, válassz egy másikat!", groups={"registration"})
*/
class User implements UserInterface, AdvancedUserInterface
{
/**
* @var integer $id
*/
private $id;
/**
* @var integer $id
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\Column(type="integer")
*/
private $id;
/**
* @var string $username
*/
private $username;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* @var string $password
*/
private $password;
/**
* @var string $username
* @ORM\Column(type="string", length=50, nullable=false, unique=true)
* @Assert\NotBlank(groups={"registration"})
*/
private $username;
/**
* @var string $email
*/
private $email;
/**
* Set username
*
* @param string $username
* @return User
*/
public function setUsername($username)
{
$this->username = $username;
return $this;
}
/**
* @var DateTime $registered_at
*/
private $registered_at;
/**
* Get username
*
* @return string
*/
public function getUsername()
{
return $this->username;
}
/**
* @var string $display_name
*/
private $display_name;
/**
* @var string $password
* @ORM\Column(type="string", length=50, nullable=false)
* @Assert\NotBlank(groups={"registration"})
*/
private $password;
/**
* @var \Doctrine\Common\Collections\ArrayCollection
*/
private $roles;
/**
* Set password
*
* @param string $password
* @return User
*/
public function setPassword($password)
{
$this->password = $password;
return $this;
}
public function __construct()
{
$this->roles = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get password
*
* @return string
*/
public function getPassword()
{
return $this->password;
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* @var string $email
* @ORM\Column(type="string", length=50, unique=true, nullable=false)
* @Assert\NotBlank(groups={"registration"})
* @Assert\Email(groups={"registration"})
*/
private $email;
/**
* Set username
*
* @param string $username
* @return User
*/
public function setUsername($username)
{
$this->username = $username;
return $this;
}
/**
* Set email
*
* @param string $email
* @return User
*/
public function setEmail($email)
{
$this->email = $email;
return $this;
}
/**
* Get username
*
* @return string
*/
public function getUsername()
{
return $this->username;
}
/**
* Get email
*
* @return string
*/
public function getEmail()
{
return $this->email;
}
/**
* Set password
*
* @param string $password
* @return User
*/
public function setPassword($password)
{
$this->password = $password;
return $this;
}
/**
* @var DateTime $registeredAt
* @ORM\Column(type="datetime", name="registered_at", nullable=false)
* @Assert\NotBlank()
* TODO: original validation.yml contained Type: \DateTime
* Assert\Type("\\DateTime")
*/
private $registeredAt;
/**
* Get password
*
* @return string
*/
public function getPassword()
{
return $this->password;
}
/**
* Set registeredAt
*
* @param DateTime $registeredAt
* @return User
*/
public function setRegisteredAt(\DateTime $registeredAt)
{
$this->registeredAt = $registeredAt;
return $this;
}
/**
* Set email
*
* @param string $email
* @return User
*/
public function setEmail($email)
{
$this->email = $email;
return $this;
}
/**
* Get registeredAt
*
* @return DateTime
*/
public function getRegisteredAt()
{
return $this->registeredAt;
}
/**
* Get email
*
* @return string
*/
public function getEmail()
{
return $this->email;
}
/**
* @var string $displayName
* @ORM\Column(type="string", length=50, nullable=false, unique=true, name="display_name")
*/
private $displayName;
/**
* Set registered_at
*
* @param DateTime $registeredAt
* @return User
*/
public function setRegisteredAt(\DateTime $registeredAt)
{
$this->registered_at = $registeredAt;
return $this;
}
/**
* Set displayName
*
* @param string $displayName
* @return User
*/
public function setDisplayName($displayName)
{
$this->displayName = $displayName;
return $this;
}
/**
* Get registered_at
*
* @return DateTime
*/
public function getRegisteredAt()
{
return $this->registered_at;
}
/**
* Get displayName
*
* @return string
*/
public function getDisplayName()
{
return $this->displayName;
}
/**
* Set display_name
*
* @param string $displayName
* @return User
*/
public function setDisplayName($displayName)
{
$this->display_name = $displayName;
return $this;
}
/**
* @var User $acceptedBy
* @ORM\ManyToOne(targetEntity="User", fetch="EXTRA_LAZY")
* @ORM\JoinColumn(name="accepted_by_id", referencedColumnName="id")
*/
private $acceptedBy;
/**
* Get display_name
*
* @return string
*/
public function getDisplayName()
{
return $this->display_name;
}
/**
* Set acceptedBy
*
* @param User $acceptedBy
* @return User
*/
public function setAcceptedBy(User $acceptedBy = null)
{
$this->acceptedBy = $acceptedBy;
return $this;
}
/**
* Add roles
*
* @param KekRozsak\FrontBundle\Entity\Role $roles
* @return User
*/
public function addRole(\KekRozsak\FrontBundle\Entity\Role $roles)
{
$this->roles[] = $roles;
return $this;
}
/**
* Get acceptedBy
*
* @return User
*/
public function getAcceptedBy()
{
return $this->acceptedBy;
}
/**
* Get roles
*
* @return Doctrine\Common\Collections\Collection
*/
public function getRoles()
{
return $this->roles->toArray();
}
/**
* @var datetime $lastLoginAt
* @ORM\Column(type="datetime", nullable=true, name="last_login_at")
*/
private $lastLoginAt;
public function getRolesCollection()
{
return $this->roles;
}
/**
* Set lastLoginAt
*
* @param DateTime $lastLoginAt
* @return User
*/
public function setLastLoginAt(\DateTime $lastLoginAt = null)
{
$this->lastLoginAt = $lastLoginAt;
return $this;
}
public function eraseCredentials()
{
}
/**
* Get lastLoginAt
*
* @return DateTime
*/
public function getLastLoginAt()
{
return $this->lastLoginAt;
}
public function getSalt()
{
return $this->password;
}
/**
* @var \Doctrine\Common\Collections\ArrayCollection
*/
private $articles;
/**
* @var \Doctrine\Common\Collections\ArrayCollection
* @ORM\OneToMany(targetEntity="Article", mappedBy="createdBy", fetch="EXTRA_LAZY")
*/
private $articles;
/**
* @var \Doctrine\Common\Collections\ArrayCollection
*/
private $forum_posts;
/**
* Add articles
*
* @param Article $articles
* @return User
*/
public function addArticle(Article $articles)
{
$this->articles[] = $articles;
return $this;
}
/**
* Get articles
*
* @return Doctrine\Common\Collections\Collection
*/
public function getArticles()
{
return $this->articles;
}
/**
* Add articles
*
* @param KekRozsak\FrontBundle\Entity\Article $articles
* @return User
*/
public function addArticle(\KekRozsak\FrontBundle\Entity\Article $articles)
{
$this->articles[] = $articles;
return $this;
}
/**
* @var \Doctrine\Common\Collections\ArrayCollection
* @ORM\OneToMany(targetEntity="ForumPost", mappedBy="createdBy", fetch="EXTRA_LAZY")
*/
private $forumPosts;
/**
* Get articles
*
* @return Doctrine\Common\Collections\Collection
*/
public function getArticles()
{
return $this->articles;
}
/**
* Add forumPosts
*
* @param ForumPost $forumPosts
* @return User
*/
public function addForumPost(ForumPost $forumPosts)
{
$this->forumPosts[] = $forumPosts;
return $this;
}
/**
* 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 forumPosts
*
* @return Doctrine\Common\Collections\Collection
*/
public function getForumPosts()
{
return $this->forumPosts;
}
/**
* Get forum_posts
*
* @return Doctrine\Common\Collections\Collection
*/
public function getForumPosts()
{
return $this->forum_posts;
}
/**
* @var KekRozsak\FrontBundle\Entity\User
*/
private $accepted_by;
/**
* @var \Doctrine\Common\Collections\ArrayCollection $ledGroups
* @ORM\OneToMany(targetEntity="Group", mappedBy="leader", fetch="EXTRA_LAZY")
*/
private $ledGroups;
/**
* Add ledGroups
*
* @param Group $group
* @return User
*/
public function addGroup(Group $group)
{
$this->ledGroups[] = $group;
return $this;
}
/**
* Set accepted_by
*
* @param KekRozsak\FrontBundle\Entity\User $acceptedBy
* @return User
*/
public function setAcceptedBy(\KekRozsak\FrontBundle\Entity\User $acceptedBy = null)
{
$this->accepted_by = $acceptedBy;
return $this;
}
/**
* Get ledGroups
*
* @return Doctrine\Common\Collections\Collection
*/
public function getLedGroups()
{
return $this->ledGroups;
}
/**
* Get accepted_by
*
* @return KekRozsak\FrontBundle\Entity\User
*/
public function getAcceptedBy()
{
return $this->accepted_by;
}
/**
* @var \Doctrine\Common\Collections\ArrayCollection $createdDocuments
* @ORM\OneToMany(targetEntity="Document", mappedBy="createdBy", fetch="EXTRA_LAZY")
*/
private $createdDocuments;
public function isAccountNonExpired()
{
return true;
}
/**
* Add createdDocuments
*
* @param Document $document
* @return User
*/
public function addDocument(Document $document)
{
$this->createdDocuments[] = $document;
return $this;
}
public function isAccountNonLocked()
{
return true;
}
/**
* Get createdDocuments
*
* @return Doctrine\Common\Collections\Collection
*/
public function getCreatedDocuments()
{
return $this->createdDocuments;
}
public function isCredentialsNonExpired()
{
return true;
}
/**
* @var UserData $userData
* @ORM\OneToOne(targetEntity="UserData", mappedBy="user", fetch="EXTRA_LAZY", cascade={"persist"})
* @ORM\JoinColumn(name="id", referencedColumnName="user_id")
*/
private $userData;
public function isEnabled()
{
return ($this->accepted_by !== null);
}
/**
* @var datetime $last_login_at
*/
private $last_login_at;
/**
* Set userData
*
* @param UserData $userData
* @return User
*/
public function setUserData(UserData $userData = null)
{
$this->userData = $userData;
return $this;
}
/**
* Get userData
*
* @return UserData
*/
public function getUserData()
{
return $this->userData;
}
/**
* Set last_login_at
*
* @param datetime $lastLoginAt
* @return User
*/
public function setLastLoginAt($lastLoginAt)
{
$this->last_login_at = $lastLoginAt;
return $this;
}
/**
* @var PollAnswer
* @ORM\ManyToMany(targetEntity="PollAnswer", mappedBy="voters", fetch="EXTRA_LAZY")
*/
private $pollVotes;
/**
* Get last_login_at
*
* @return datetime
*/
public function getLastLoginAt()
{
return $this->last_login_at;
}
/**
* @var KekRozsak\FrontBundle\Entity\UserData
*/
private $user_data;
/**
* Set pollVotes
*
* @param PollAnswer $pollVotes
* @return User
*/
public function setPollVotes(PollAnswer $pollVotes = null)
{
$this->pollVotes = $pollVotes;
return $this;
}
/**
* Get pollVotes
*
* @return PollAnswer
*/
public function getPollVotes()
{
return $this->pollVotes;
}
/**
* Set user_data
*
* @param KekRozsak\FrontBundle\Entity\UserData $userData
* @return User
*/
public function setUserData(\KekRozsak\FrontBundle\Entity\UserData $userData = null)
{
$this->user_data = $userData;
return $this;
}
/**
* Add pollVotes
*
* @param PollAnswer $pollVotes
* @return User
*/
public function addPollAnswer(PollAnswer $pollVotes)
{
$this->pollVotes[] = $pollVotes;
return $this;
}
/**
* Get user_data
*
* @return KekRozsak\FrontBundle\Entity\UserData
*/
public function getUserData()
{
return $this->user_data;
}
/**
* UserInterface::eraseCredentials()
*/
public function eraseCredentials()
{
}
/**
* UserInterface::getSalt()
*
* As we use crypt() to encrypt and check password, salt is always the
* same as the encrypted password.
*/
public function getSalt()
{
return $this->password;
}
/**
* UserInterface::getRoles
*/
public function getRoles()
{
return array('ROLE_USER');
}
/**
* AdvancedUserInterface::isAccountNonExpired()
*/
public function isAccountNonExpired()
{
return true;
}
/**
* AdvancedUserInterface::isAccountNonLocked()
*/
public function isAccountNonLocked()
{
return true;
}
/**
* AdvancedUserInterface::isCredentialsNonExpired()
*/
public function isCredentialsNonExpired()
{
return true;
}
/**
* AdvancedUserInterface::isEnabled()
*/
public function isEnabled()
{
return ($this->acceptedBy !== null);
}
}

View File

@ -4,388 +4,379 @@ namespace KekRozsak\FrontBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use KekRozsak\FrontBundle\Entity\User;
/**
* KekRozsak\FrontBundle\Entity\UserData
* @ORM\Entity
* @ORM\Table(name="user_data")
*/
class UserData
{
/**
* @var KekRozsak\FrontBundle\Entity\User
*/
private $user;
/**
* @var User $user
* @ORM\Id
* @ORM\OneToOne(targetEntity="User", inversedBy="userData")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
*/
protected $user;
/**
* Set user
*
* @param User $user
* @return UserData
*/
public function setUser(User $user = null)
{
$this->user = $user;
$this->userId = $user->getId();
return $this;
}
/**
* Set user
*
* @param KekRozsak\FrontBundle\Entity\User $user
* @return UserData
*/
public function setUser(\KekRozsak\FrontBundle\Entity\User $user = null)
{
$this->user = $user;
$this->user_id = $user->getId();
return $this;
}
/**
* Get user
*
* @return User
*/
public function getUser()
{
return $this->user;
}
/**
* Get user
*
* @return KekRozsak\FrontBundle\Entity\User
*/
public function getUser()
{
return $this->user;
}
/**
* @var integer $user_id
*/
private $user_id;
/**
* @var boolean $emailPublic
* @ORM\Column(type="boolean", name="email_public")
*/
protected $emailPublic;
/**
* @var string $realName
*/
private $realName;
/**
* Set emailPublic
*
* @param boolean $emailPublic
* @return UserData
*/
public function setEmailPublic($emailPublic)
{
$this->emailPublic = $emailPublic;
return $this;
}
/**
* @var boolean $realNamePublic
*/
private $realNamePublic;
/**
* Get emailPublic
*
* @return boolean
*/
public function getEmailPublic()
{
return $this->emailPublic;
}
/**
* @var string $realName
* @ORM\Column(name="real_name", type="string", length=100, nullable=true)
*/
protected $realName;
/**
* Set user_id
*
* @param integer $userId
* @return UserData
*/
public function setUserId($userId)
{
$this->user_id = $userId;
return $this;
}
/**
* Set realName
*
* @param string $realName
* @return UserData
*/
public function setRealName($realName)
{
$this->realName = $realName;
return $this;
}
/**
* Get user_id
*
* @return integer
*/
public function getUserId()
{
return $this->user_id;
}
/**
* Get realName
*
* @return string
*/
public function getRealName()
{
return $this->realName;
}
/**
* Set realName
*
* @param string $realName
* @return UserData
*/
public function setRealName($realName)
{
$this->realName = $realName;
return $this;
}
/**
* @var boolean $realNamePublic
* @ORM\Column(name="real_name_public", type="boolean", nullable=false)
*/
protected $realNamePublic;
/**
* Get realName
*
* @return string
*/
public function getRealName()
{
return $this->realName;
}
/**
* Set realNamePublic
*
* @param boolean $realNamePublic
* @return UserData
*/
public function setRealNamePublic($realNamePublic)
{
$this->realNamePublic = $realNamePublic;
return $this;
}
/**
* Set realNamePublic
*
* @param boolean $realNamePublic
* @return UserData
*/
public function setRealNamePublic($realNamePublic)
{
$this->realNamePublic = $realNamePublic;
return $this;
}
/**
* Get realNamePublic
*
* @return boolean
*/
public function getRealNamePublic()
{
return $this->realNamePublic;
}
/**
* Get realNamePublic
*
* @return boolean
*/
public function getRealNamePublic()
{
return $this->realNamePublic;
}
/**
* @var text $selfDescription
*/
private $selfDescription;
/**
* @var text $selfDescription
* @ORM\Column(name="self_description", type="text", nullable=true)
*/
protected $selfDescription;
/**
* @var boolean $emailPublic
*/
private $emailPublic;
/**
* Set selfDescription
*
* @param text $selfDescription
* @return UserData
*/
public function setSelfDescription($selfDescription)
{
$this->selfDescription = $selfDescription;
return $this;
}
/**
* Get selfDescription
*
* @return text
*/
public function getSelfDescription()
{
return $this->selfDescription;
}
/**
* Set selfDescription
*
* @param text $selfDescription
* @return UserData
*/
public function setSelfDescription($selfDescription)
{
$this->selfDescription = $selfDescription;
return $this;
}
/**
* @var string $msnAddress
* @ORM\Column(type="string", length=100, name="msn_address", nullable=true)
*/
protected $msnAddress;
/**
* Get selfDescription
*
* @return text
*/
public function getSelfDescription()
{
return $this->selfDescription;
}
/**
* Set msnAddress
*
* @param string $msnAddress
* @return UserData
*/
public function setMsnAddress($msnAddress)
{
$this->msnAddress = $msnAddress;
return $this;
}
/**
* Set emailPublic
*
* @param boolean $emailPublic
* @return UserData
*/
public function setEmailPublic($emailPublic)
{
$this->emailPublic = $emailPublic;
return $this;
}
/**
* Get msnAddress
*
* @return string
*/
public function getMsnAddress()
{
return $this->msnAddress;
}
/**
* Get emailPublic
*
* @return boolean
*/
public function getEmailPublic()
{
return $this->emailPublic;
}
/**
* @var string $msnAddress
*/
private $msnAddress;
/**
* @var boolean $msnAddressPublic
* @ORM\Column(type="boolean", name="msn_address_public", nullable=false)
*/
protected $msnAddressPublic;
/**
* @var boolean $msnAddressPublic
*/
private $msnAddressPublic;
/**
* Set msnAddressPublic
*
* @param boolean $msnAddressPublic
* @return UserData
*/
public function setMsnAddressPublic($msnAddressPublic)
{
$this->msnAddressPublic = $msnAddressPublic;
return $this;
}
/**
* @var string $googleTalk
*/
private $googleTalk;
/**
* Get msnAddressPublic
*
* @return boolean
*/
public function getMsnAddressPublic()
{
return $this->msnAddressPublic;
}
/**
* @var boolean $googleTalkPublic
*/
private $googleTalkPublic;
/**
* @var string $googleTalk
* @ORM\Column(type="string", length=100, name="google_talk", nullable=true)
*/
protected $googleTalk;
/**
* @var string $skype
*/
private $skype;
/**
* Set googleTalk
*
* @param string $googleTalk
* @return UserData
*/
public function setGoogleTalk($googleTalk)
{
$this->googleTalk = $googleTalk;
return $this;
}
/**
* @var boolean $skypePublic
*/
private $skypePublic;
/**
* Get googleTalk
*
* @return string
*/
public function getGoogleTalk()
{
return $this->googleTalk;
}
/**
* @var boolean $googleTalkPublic
* @ORM\Column(type="boolean", name="google_talk_public", nullable=false)
*/
protected $googleTalkPublic;
/**
* Set msnAddress
*
* @param string $msnAddress
* @return UserData
*/
public function setMsnAddress($msnAddress)
{
$this->msnAddress = $msnAddress;
return $this;
}
/**
* Set googleTalkPublic
*
* @param boolean $googleTalkPublic
* @return UserData
*/
public function setGoogleTalkPublic($googleTalkPublic)
{
$this->googleTalkPublic = $googleTalkPublic;
return $this;
}
/**
* Get msnAddress
*
* @return string
*/
public function getMsnAddress()
{
return $this->msnAddress;
}
/**
* Get googleTalkPublic
*
* @return boolean
*/
public function getGoogleTalkPublic()
{
return $this->googleTalkPublic;
}
/**
* Set msnAddressPublic
*
* @param boolean $msnAddressPublic
* @return UserData
*/
public function setMsnAddressPublic($msnAddressPublic)
{
$this->msnAddressPublic = $msnAddressPublic;
return $this;
}
/**
* @var string $skype
* @ORM\Column(type="string", length=100, nullable=true)
*/
protected $skype;
/**
* Get msnAddressPublic
*
* @return boolean
*/
public function getMsnAddressPublic()
{
return $this->msnAddressPublic;
}
/**
* Set skype
*
* @param string $skype
* @return UserData
*/
public function setSkype($skype)
{
$this->skype = $skype;
return $this;
}
/**
* Set googleTalk
*
* @param string $googleTalk
* @return UserData
*/
public function setGoogleTalk($googleTalk)
{
$this->googleTalk = $googleTalk;
return $this;
}
/**
* Get skype
*
* @return string
*/
public function getSkype()
{
return $this->skype;
}
/**
* Get googleTalk
*
* @return string
*/
public function getGoogleTalk()
{
return $this->googleTalk;
}
/**
* @var boolean $skypePublic
* @ORM\Column(type="boolean", name="skype_public", nullable=false)
*/
protected $skypePublic;
/**
* Set googleTalkPublic
*
* @param boolean $googleTalkPublic
* @return UserData
*/
public function setGoogleTalkPublic($googleTalkPublic)
{
$this->googleTalkPublic = $googleTalkPublic;
return $this;
}
/**
* Set skypePublic
*
* @param boolean $skypePublic
* @return UserData
*/
public function setSkypePublic($skypePublic)
{
$this->skypePublic = $skypePublic;
return $this;
}
/**
* Get googleTalkPublic
*
* @return boolean
*/
public function getGoogleTalkPublic()
{
return $this->googleTalkPublic;
}
/**
* Get skypePublic
*
* @return boolean
*/
public function getSkypePublic()
{
return $this->skypePublic;
}
/**
* Set skype
*
* @param string $skype
* @return UserData
*/
public function setSkype($skype)
{
$this->skype = $skype;
return $this;
}
/**
* @var string $phoneNumber
* @ORM\Column(type="string", length=30, name="phone_number", nullable=true)
*/
protected $phoneNumber;
/**
* Get skype
*
* @return string
*/
public function getSkype()
{
return $this->skype;
}
/**
* Set phoneNumber
*
* @param string $phoneNumber
* @return UserData
*/
public function setPhoneNumber($phoneNumber = null)
{
$this->phoneNumber = $phoneNumber;
return $this;
}
/**
* Set skypePublic
*
* @param boolean $skypePublic
* @return UserData
*/
public function setSkypePublic($skypePublic)
{
$this->skypePublic = $skypePublic;
return $this;
}
/**
* Get phoneNumber
*
* @return string
*/
public function getPhoneNumber()
{
return $this->phoneNumber;
}
/**
* Get skypePublic
*
* @return boolean
*/
public function getSkypePublic()
{
return $this->skypePublic;
}
/**
* @var string $phoneNumber
*/
private $phoneNumber;
/**
* @var boolean $phoneNumberPublic
* @ORM\Column(type="boolean", name="phone_number_public", nullable=false)
*/
protected $phoneNumberPublic;
/**
* @var boolean $phoneNumberPublic
*/
private $phoneNumberPublic;
/**
* Set phoneNumberPublic
*
* @param boolean $phoneNumberPublic
* @return UserData
*/
public function setPhoneNumberPublic($phoneNumberPublic)
{
$this->phoneNumberPublic = $phoneNumberPublic;
return $this;
}
/**
* Set phoneNumber
*
* @param string $phoneNumber
* @return UserData
*/
public function setPhoneNumber($phoneNumber)
{
$this->phoneNumber = $phoneNumber;
return $this;
}
/**
* Get phoneNumber
*
* @return string
*/
public function getPhoneNumber()
{
return $this->phoneNumber;
}
/**
* Set phoneNumberPublic
*
* @param boolean $phoneNumberPublic
* @return UserData
*/
public function setPhoneNumberPublic($phoneNumberPublic)
{
$this->phoneNumberPublic = $phoneNumberPublic;
return $this;
}
/**
* Get phoneNumberPublic
*
* @return boolean
*/
public function getPhoneNumberPublic()
{
return $this->phoneNumberPublic;
}
/**
* Get phoneNumberPublic
*
* @return boolean
*/
public function getPhoneNumberPublic()
{
return $this->phoneNumberPublic;
}
}

View File

@ -17,7 +17,7 @@ class ForumPostType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('created_at', 'hidden', array(
$builder->add('createdAt', 'hidden', array(
'label' => 'Időpont',
'data' => new \DateTime('now')
));

View File

@ -42,7 +42,7 @@ class UserType extends AbstractType
));
if (!$this->_registration)
{
$builder->add('user_data', new UserDataType(), array(
$builder->add('userData', new UserDataType(), array(
'label' => 'Egyéb adatok',
));
}

View File

@ -1,44 +0,0 @@
KekRozsak\FrontBundle\Entity\Article:
type: entity
table: articles
id:
id:
type: integer
generator:
strategy: AUTO
fields:
title:
type: string(100)
nullable: false
slug:
type: string(100)
nullable: false
unique: true
text:
type: text
nullable: false
source:
type: string(255)
nullable: true
created_at:
type: datetime
nullable: false
updated_at:
type: datetime
nullable: true
update_reason:
type: text
nullable: true
main_page:
type: boolean
nullable: true
default: false
manyToOne:
created_by:
targetEntity: User
inversedBy: articles
nullable: false
updated_by:
targetEntity: User
nullable: true
default: null

View File

@ -1,33 +0,0 @@
KekRozsak\FrontBundle\Entity\ForumPost:
type: entity
table: forum_posts
id:
id:
type: integer
generator:
strategy: AUTO
fields:
created_at:
type: datetime
nullable: false
updated_at:
type: datetime
nullable: true
update_reason:
type: string
nullable: true
text:
type: text
nullable: false
manyToOne:
created_by:
targetEntity: User
inversedBy: forum_posts
nullable: false
updated_by:
targetEntity: User
nullable: true
default: null
topic:
targetEntity: ForumTopic
inversedBy: posts

View File

@ -1,50 +0,0 @@
KekRozsak\FrontBundle\Entity\ForumTopic:
type: entity
table: forum_topics
id:
id:
type: integer
generator:
strategy: AUTO
fields:
title:
type: string(100)
nullable: false
slug:
type: string(100)
nullable: false
created_at:
type: datetime
nullable: false
updated_at:
type: datetime
nullable: true
update_reason:
type: text
nullable: true
oneToMany:
posts:
targetEntity: ForumPost
mappedBy: topic
manyToOne:
created_by:
targetEntity: User
inversedBy: articles
nullable: false
updated_by:
targetEntity: User
nullable: true
default: null
topic_group:
targetEntity: ForumTopicGroup
inversedBy: topics
nullable: false
oneToOne:
last_post:
targetEntity: ForumPost
nullable: true
default: null
cascade: [ persist ]
uniqueConstraint:
uniqueSlugByGroup:
columns: [ topic_group, slug ]

View File

@ -1,44 +0,0 @@
KekRozsak\FrontBundle\Entity\ForumTopicGroup:
type: entity
table: forum_topic_groups
id:
id:
type: integer
generator:
strategy: AUTO
fields:
title:
type: string(100)
nullable: false
slug:
type: string(100)
nullable: false
unique: true
created_at:
type: datetime
nullable: false
updated_at:
type: datetime
nullable: true
update_reason:
type: text
nullable: true
manyToOne:
created_by:
targetEntity: User
inversedBy: articles
nullable: false
updated_by:
targetEntity: User
nullable: true
default: null
oneToOne:
last_post:
targetEntity: ForumPost
nullable: true
default: null
cascade: [ persist ]
oneToMany:
topics:
targetEntity: ForumTopic
mappedBy: topic_group

View File

@ -1,39 +0,0 @@
KekRozsak\FrontBundle\Entity\News:
type: entity
table: news
id:
id:
type: integer
generator:
strategy: AUTO
fields:
created_at:
type: datetime
nullable: false
updated_at:
type: datetime
nullable: true
default: null
update_reason:
type: text
nullable: true
default: null
title:
type: string(100)
nullable: false
slug:
type: string(100)
nullable: false
unique: true
text:
type: text
nullable: false
manyToOne:
created_by:
targetEntity: User
nullable: false
inversedBy: news
updated_by:
targetEntity: User
nullable: true
default: null

View File

@ -1,30 +0,0 @@
KekRozsak\FrontBundle\Entity\Role:
type: entity
table: roles
id:
id:
type: integer
generator:
strategy: AUTO
fields:
name:
type: string(100)
nullable: false
display_name:
type: string(100)
nullable: false
can_be_assigned:
type: boolean
default: false
manyToMany:
included_roles:
targetEntity: Role
joinTable:
name: role_hierarchy
joinColumns:
parent_role_id:
referencedColumnName: id
inverseJoinColumns:
child_role_id:
referencedColumnName: id

View File

@ -1,51 +0,0 @@
KekRozsak\FrontBundle\Entity\User:
type: entity
table: users
id:
id:
type: integer
generator:
strategy: AUTO
fields:
username:
type: string(50)
nullable: false
password:
type: string(50)
nullable: false
email:
type: string(50)
nullable: false
registered_at:
type: datetime
display_name:
type: string(50)
nullable: false
last_login_at:
type: datetime
nullable: true
default: null
oneToMany:
articles:
targetEntity: Article
mappedBy: created_by
fetch: EXTRA_LAZY
forum_posts:
targetEntity: ForumPost
mappedBy: created_by
fetch: EXTRA_LAZY
manyToOne:
accepted_by:
targetEntity: User
fetch: EXTRA_LAZY
manyToMany:
roles:
targetEntity: Role
oneToOne:
user_data:
targetEntity: UserData
mappedBy: user
joinColumns:
id:
referencedColumnName: user_id
cascade: [ 'persist' ]

View File

@ -1,71 +0,0 @@
KekRozsak\FrontBundle\Entity\UserData:
type: entity
table: user_data
id:
user_id:
type: integer
fields:
emailPublic:
type: boolean
nullable: false
default: false
realName:
name: real_name
type: string(100)
nullable: true
default: null
realNamePublic:
name: real_name_public
type: boolean
nullable: true
default: false
selfDescription:
name: self_description_public
type: text
nullable: true
default: null
msnAddress:
name: msn
type: string(100)
nullable: true
default: null
msnAddressPublic:
name: msn_public
type: boolean
nullable: false
default: false
googleTalk:
name: google_talk
type: string(100)
nullable: true
default: null
googleTalkPublic:
name: goole_talk_public
type: boolean
nullable: false
default: false
skype:
type: string(100)
nullable: true
default: null
skypePublic:
name: skype_public
type: boolean
nullable: false
default: false
phoneNumber:
name: phone_number
type: string(30)
nullable: true
phoneNumberPublic:
name: phone_number_public
type: boolean
nullable: false
default: false
oneToOne:
user:
targetEntity: User
inversedBy: user_data
joinColumns:
user_id:
referencedColumnName: id

View File

@ -1,38 +0,0 @@
KekRozsakFrontBundle_homepage:
pattern: /
defaults:
_controller: KekRozsakFrontBundle:Default:homepage
KekRozsakFrontBundle_article:
pattern: /cikk/{articleSlug}
defaults:
_controller: KekRozsakFrontBundle:Default:article
KekRozsakFrontBundle_forum_main:
pattern: /forum
defaults:
_controller: KekRozsakFrontBundle:Forum:main
KekRozsakFrontBundle_forum_topic_list:
pattern: /forum/{topicGroupSlug}
defaults:
_controller: KekRozsakFrontBundle:Forum:topicList
KekRozsakFrontBundle_forum_post_list:
pattern: /forum/{topicGroupSlug}/{topicSlug}
defaults:
_controller: KekRozsakFrontBundle:Forum:postList
requirements:
_method: GET
KekRozsakFrontBundle_forum_new_post:
pattern: /forum/{topicGroupSlug}/{topicSlug}/post
defaults:
_controller: KekRozsakFrontBundle:Forum:postList
requirements:
_method: POST
KekRozsakFrontBundle_profile_edit:
pattern: /profil
defaults:
_controller: KekRozsakFrontBundle:Default:profileEdit

View File

@ -0,0 +1,17 @@
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="kek_rozsak_front.twig_extension.news" class="KekRozsak\FrontBundle\Twig\NewsExtension">
<argument type="service" id="doctrine" />
<tag name="twig.extension" />
</service>
<service id="form.type_extension.help_message" class="KekRozsak\FrontBundle\Form\Extension\HelpMessageTypeExtension">
<tag name="form.type_extension" alias="field" />
</service>
<service id="bb.twig.extension" class="KekRozsak\FrontBundle\Extension\TwigBBExtension">
<argument type="service" id="service_container" />
<tag name="twig.extension" />
</service>
</services>
</container>

View File

@ -1,23 +0,0 @@
parameters:
# kek_rozsak_front.example.class: KekRozsak\FrontBundle\Example
services:
# kek_rozsak_front.example:
# class: %kek_rozsak_front.example.class%
# arguments: [@service_id, "plain_value", %parameter%]
kek_rozsak_front.twig_extension.news:
class: KekRozsak\FrontBundle\Twig\NewsExtension
arguments:
doctrine: @doctrine
tags:
- { name: twig.extension }
form.type_extension.help_message:
class: KekRozsak\FrontBundle\Form\Extension\HelpMessageTypeExtension
tags:
- { name: "form.type_extension", alias: "field" }
bb.twig.extension:
class: KekRozsak\FrontBundle\Extension\TwigBBExtension
arguments:
- @service_container
tags:
- { name: "twig.extension" }

View File

@ -1,29 +0,0 @@
KekRozsak\FrontBundle\Entity\User:
constraints:
- Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
fields: username
message: "Ez a felhasználónév már foglalt. Kérlek, válassz egy másikat!"
groups: [ registration ]
- Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
fields: email
message: "Ez az e-mail cím már foglalt. Kérlek, válassz egy másikat!"
groups: [ registration ]
- Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
fields: display_name
message: "Ez a név már foglalt. Kérlek, válassz egy másikat!"
groups: [ registration ]
properties:
username:
- NotBlank: { groups: [ registration ] }
password:
- NotBlank: { groups: [ registration ] }
email:
- NotBlank: { groups: [ registration ] }
- Email: { groups: [ registration ] }
registered_at:
- NotBlank: ~
- Type: \DateTime
display_name:
- NotBlank: { groups: [ registration ] }
KekRozsak\FrontBundle\Form\Type\UserType:

View File

@ -6,7 +6,7 @@
<tbody>
<tr>
<td class="uj-post">
<form method="post" action="{{ path('KekRozsakFrontBundle_forum_new_post', { topicGroupSlug: topicGroup.slug, topicSlug: topic.slug } ) }}">
<form method="post" action="{{ path('KekRozsakFrontBundle_forum_post_list', { topicGroupSlug: topicGroup.slug, topicSlug: topic.slug } ) }}">
{{ form_widget(form) }}
<p>
<span class="eszkoztar">Súgó</span><span class="kuldes-gomb" /><button type="submit">Küldés</button>

View File

@ -16,7 +16,7 @@ class NewsExtension extends \Twig_Extension
public function getGlobals()
{
$newsRepo = $this->doctrine->getRepository('KekRozsakFrontBundle:News');
$news = $newsRepo->findBy(array(), array('created_at' => 'DESC'), 4);
$news = $newsRepo->findBy(array(), array('createdAt' => 'DESC'), 4);
return array(
'recentNews' => $news,

View File

@ -6,12 +6,16 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\User\UserInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use KekRozsak\FrontBundle\Entity\User;
use KekRozsak\FrontBundle\Form\Type\UserType;
class DefaultController extends Controller
{
/**
* @Route("/login", name="KekRozsakSecurityBundle_login")
*/
public function loginAction()
{
$request = $this->getRequest();
@ -33,6 +37,25 @@ class DefaultController extends Controller
));
}
/**
* @Route("/login_check", name="KekRozsakSecurityBundle_login_check")
*/
public function loginCheckAction()
{
// The security layer will intercept this request. This method will never be called.
}
/**
* @Route("/logout", name="KekRozsakSecurityBundle_logout")
*/
public function logoutAction()
{
// The security layer will intercept this request. This method will never be called.
}
/**
* @Route("/jelentkezes", name="KekRozsakSecurityBundle_registration")
*/
public function registrationAction(Request $request)
{
$user = $this->get('security.context')->getToken()->getUser();
@ -73,6 +96,9 @@ class DefaultController extends Controller
));
}
/**
* @Route("/most-varj", name="KekRozsakSecurityBundle_reg_success")
*/
public function registrationSuccessAction()
{
return $this->render('KekRozsakSecurityBundle:Default:registration_success.html.twig', array());

View File

@ -1,20 +0,0 @@
KekRozsakSecurityBundle_login:
pattern: /login
defaults:
_controller: KekRozsakSecurityBundle:Default:login
KekRozsakSecurityBundle_login_check:
pattern: /login_check
KekRozsakSecurityBundle_logout:
pattern: /logout
KekRozsakSecurityBundle_registration:
pattern: /jelentkezes
defaults:
_controller: KekRozsakSecurityBundle:Default:registration
KekRozsakSecurityBundle_reg_success:
pattern: /most-varj
defaults:
_controller: KekRozsakSecurityBundle:Default:registrationSuccess

View File

@ -1,4 +1,5 @@
{# vim: ft=htmljinja: #}
{# vim: ft=htmljinja:
#}
{% extends '::main_template.html.twig' %}
{% form_theme form 'KekRozsakFrontBundle:Form:user_form.html.twig' %}
{% block title %} - Regisztráció {% endblock %}