Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Feb 5th, 2012  |  syntax: None  |  size: 2.14 KB  |  hits: 48  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. config/fos_comment.yml :
  2. fos_comment:
  3.     db_driver:     orm
  4.     class:
  5.         model:
  6.             comment: MG\ChatBundle\Entity\Comment\Comment
  7.             thread: MG\ChatBundle\Entity\Comment\Thread
  8.  
  9. Smarty tpl :
  10.  
  11. <p> id : {{ 'MGTeamBundle:Team:' ~ team.id }} </p>
  12. {% include 'FOSCommentBundle:Thread:async.html.twig' with {'id': 'MGTeamBundle:Team:' ~ team.id } %}
  13.  
  14. <?php
  15.  
  16. namespace MG\ChatBundle\Entity\Comment;
  17.  
  18. use Doctrine\ORM\Mapping as ORM;
  19. use FOS\CommentBundle\Entity\Comment as BaseComment;
  20. use FOS\CommentBundle\Model\ThreadInterface;
  21.  
  22. /**
  23.  * MG\ChatBundle\Entity\Comment
  24.  *
  25.  * @ORM\Table(name="comment__comments")
  26.  * @ORM\Entity
  27.  * @ORM\ChangeTrackingPolicy("DEFERRED_EXPLICIT")
  28.  */
  29. class Comment extends BaseComment {
  30.  
  31.     /**
  32.      * @var integer $id
  33.      *
  34.      * @ORM\Column(name="id", type="integer")
  35.      * @ORM\Id
  36.      * @ORM\GeneratedValue(strategy="AUTO")
  37.      */
  38.     protected $id;
  39.  
  40.     /**
  41.      * Get id
  42.      *
  43.      * @return integer
  44.      */
  45.     public function getId() {
  46.         return $this->id;
  47.     }
  48.  
  49.     /**
  50.      * Thread of this comment
  51.      *
  52.      * @var Thread
  53.      * @ORM\ManyToOne(targetEntity="MG\ChatBundle\Entity\Comment\Thread")
  54.      */
  55.     protected $thread;
  56.  
  57.     /**
  58.      * @return Thread
  59.      */
  60.     public function getThread() {
  61.         return $this->thread;
  62.     }
  63.  
  64.     /**
  65.      * @param Thread $thread
  66.      * @return null
  67.      */
  68.     public function setThread(ThreadInterface $thread) {
  69.         $this->thread = $thread;
  70.     }
  71.  
  72. }
  73.  
  74. <?php
  75.  
  76. namespace MG\ChatBundle\Entity\Comment;
  77.  
  78. use Doctrine\ORM\Mapping as ORM;
  79. use FOS\CommentBundle\Entity\Thread as BaseThread;
  80.  
  81. /**
  82.  * MG\ChatBundle\Entity\Thread
  83.  *
  84.  * @ORM\Table(name="comment__threads")
  85.  * @ORM\Entity
  86.  * @ORM\ChangeTrackingPolicy("DEFERRED_EXPLICIT")
  87.  */
  88. class Thread extends BaseThread {
  89.  
  90.     /**
  91.      * @var integer $id
  92.      *
  93.      * @ORM\Column(name="id", type="integer")
  94.      * @ORM\Id
  95.      * @ORM\GeneratedValue(strategy="AUTO")
  96.      */
  97.     protected $id;
  98.  
  99.     /**
  100.      * Get id
  101.      *
  102.      * @return integer
  103.      */
  104.     public function getId() {
  105.         return $this->id;
  106.     }
  107.  
  108. }