Created
February 28, 2013 21:21
-
-
Save bakura10/5060233 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace PrivateMessaging\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
use User\Entity\AbstractUser; | |
/** | |
* @ORM\Entity | |
* @ORM\Table(name="UsersThreads", uniqueConstraints={ | |
* @ORM\UniqueConstraint(name="UNIQ_4ED6B6AAA76ED395", columns={"user_id", "thread_id"}) | |
* }) | |
*/ | |
class UserThread | |
{ | |
/** | |
* @var int | |
* | |
* @ORM\Id | |
* @ORM\Column(type="integer") | |
* @ORM\GeneratedValue(strategy="AUTO") | |
*/ | |
protected $id; | |
/** | |
* @var AbstractUser | |
* | |
* @ORM\ManyToOne(targetEntity="User\Entity\AbstractUser") | |
* @ORM\JoinColumn(onDelete="cascade") | |
*/ | |
protected $user; | |
/** | |
* @var Thread | |
* | |
* @ORM\ManyToOne(targetEntity="Thread", inversedBy="participants")) | |
* @ORM\JoinColumn(onDelete="cascade") | |
*/ | |
protected $thread; | |
/** | |
* @param AbstractUser $user | |
* @param Thread $thread | |
*/ | |
public function __construct(AbstractUser $user, Thread $thread) | |
{ | |
$this->user = $user; | |
$this->thread = $thread; | |
} | |
// Getters/setters | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment