
Untitled
By: a guest on
Feb 5th, 2012 | syntax:
None | size: 2.14 KB | hits: 48 | expires: Never
config/fos_comment.yml :
fos_comment:
db_driver: orm
class:
model:
comment: MG\ChatBundle\Entity\Comment\Comment
thread: MG\ChatBundle\Entity\Comment\Thread
Smarty tpl :
<p> id : {{ 'MGTeamBundle:Team:' ~ team.id }} </p>
{% include 'FOSCommentBundle:Thread:async.html.twig' with {'id': 'MGTeamBundle:Team:' ~ team.id } %}
<?php
namespace MG\ChatBundle\Entity\Comment;
use Doctrine\ORM\Mapping as ORM;
use FOS\CommentBundle\Entity\Comment as BaseComment;
use FOS\CommentBundle\Model\ThreadInterface;
/**
* MG\ChatBundle\Entity\Comment
*
* @ORM\Table(name="comment__comments")
* @ORM\Entity
* @ORM\ChangeTrackingPolicy("DEFERRED_EXPLICIT")
*/
class Comment extends BaseComment {
/**
* @var integer $id
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* Get id
*
* @return integer
*/
public function getId() {
return $this->id;
}
/**
* Thread of this comment
*
* @var Thread
* @ORM\ManyToOne(targetEntity="MG\ChatBundle\Entity\Comment\Thread")
*/
protected $thread;
/**
* @return Thread
*/
public function getThread() {
return $this->thread;
}
/**
* @param Thread $thread
* @return null
*/
public function setThread(ThreadInterface $thread) {
$this->thread = $thread;
}
}
<?php
namespace MG\ChatBundle\Entity\Comment;
use Doctrine\ORM\Mapping as ORM;
use FOS\CommentBundle\Entity\Thread as BaseThread;
/**
* MG\ChatBundle\Entity\Thread
*
* @ORM\Table(name="comment__threads")
* @ORM\Entity
* @ORM\ChangeTrackingPolicy("DEFERRED_EXPLICIT")
*/
class Thread extends BaseThread {
/**
* @var integer $id
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* Get id
*
* @return integer
*/
public function getId() {
return $this->id;
}
}