Skip to content

Instantly share code, notes, and snippets.

@merk
Created June 8, 2011 11:10
Show Gist options
  • Save merk/1014217 to your computer and use it in GitHub Desktop.
Save merk/1014217 to your computer and use it in GitHub Desktop.
<?php
namespace Test\AppBundle\Entity;
use FOS\CommentBundle\Entity\Comment as BaseComment;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="test_comment")
* @author Tim Nagel <[email protected]>
*/
class Comment extends BaseComment
{
/**
* Comment id.
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* The comments parent.
*
* @orm:ManyToOne(targetEntity="Comment", inversedBy="children")
* @var Comment
*/
protected $parent;
/**
* The comment children.
*
* @orm:OneToMany(targetEntity="Comment", mappedBy="parent")
* @var array of Comment
*/
protected $children;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment