point-tools/src/Skobkin/Bundle/PointToolsBundle/Entity/Subscription.php

82 lines
1.4 KiB
PHP
Raw Normal View History

<?php
namespace Skobkin\Bundle\PointToolsBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Subscription
*
2015-05-28 17:36:52 +00:00
* @ORM\Table(name="subscriptions.subscriptions", uniqueConstraints={
* @ORM\UniqueConstraint(name="subscription_unique", columns={"author_id", "subscriber_id"})}
* )
* @ORM\Entity
*/
class Subscription
{
/**
* @var User
*
* @ORM\Id
* @ORM\ManyToOne(targetEntity="User", inversedBy="subscribers")
* @ORM\JoinColumn(name="author_id")
*/
private $author;
/**
* @var User
*
* @ORM\Id
* @ORM\ManyToOne(targetEntity="User", inversedBy="subscriptions")
* @ORM\JoinColumn(name="subscriber_id")
*/
private $subscriber;
/**
* Set author
*
* @param User $author
* @return Subscription
*/
public function setAuthor(User $author = null)
{
$this->author = $author;
return $this;
}
/**
* Get author
*
* @return User
*/
public function getAuthor()
{
return $this->author;
}
/**
* Set subscriber
*
* @param User $subscriber
* @return Subscription
*/
public function setSubscriber(User $subscriber = null)
{
$this->subscriber = $subscriber;
return $this;
}
/**
* Get subscriber
*
* @return User
*/
public function getSubscriber()
{
return $this->subscriber;
}
}