Skip to content

Instantly share code, notes, and snippets.

@yesmeck
Created November 19, 2011 15:15
Show Gist options
  • Save yesmeck/1378944 to your computer and use it in GitHub Desktop.
Save yesmeck/1378944 to your computer and use it in GitHub Desktop.
<?php
namespace OOXX\Entity;
/**
* @Entity(repositoryClass="OOXX\Entity\Repository\TopicRepository") @Table(name="topic")
*/
class Topic
{
/**
* @Id @GeneratedValue
* @Column(type="bigint")
* @var integer
*/
protected $id;
/**
* @Column(type="string", length=250)
* @var string
*/
protected $title;
/**
* @Column(type="text")
* @var string
*/
protected $content;
/**
* @Column(type="datetime")
* @var string
*/
protected $created;
/**
* @ManyToOne(targetEntity="User", inversedBy="topics")
* @var int
*/
protected $user;
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set title
*
* @param string $title
*/
public function setTitle($title)
{
$this->title = $title;
}
/**
* Get title
*
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* Set content
*
* @param string $content
*/
public function setContent($content)
{
$this->content = $content;
}
/**
* Get content
*
* @return string
*/
public function getContent()
{
return $this->content;
}
/**
* Set created time
*
* @param string $created
*/
public function setCreated($created)
{
$this->created = $created;
}
/**
* Get created time
*
* @return string
*/
public function getCreated()
{
return $this->created;
}
/**
* Set user
*
* @param object $user
*/
public function setUser(\OOXX\Entity\User $user)
{
$user->addTopic($this);
$this->user = $user;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment