diff --git a/src/Skobkin/Bundle/PointToolsBundle/Entity/SubscriptionEvent.php b/src/Skobkin/Bundle/PointToolsBundle/Entity/SubscriptionEvent.php new file mode 100644 index 0000000..d72433a --- /dev/null +++ b/src/Skobkin/Bundle/PointToolsBundle/Entity/SubscriptionEvent.php @@ -0,0 +1,158 @@ +id; + } + + /** + * Set dateTime + * + * @param \DateTime $dateTime + * @return SubscriptionEvent + */ + public function setDateTime($dateTime) + { + $this->dateTime = $dateTime; + + return $this; + } + + /** + * Get dateTime + * + * @return \DateTime + */ + public function getDateTime() + { + return $this->dateTime; + } + + /** + * Set subscriber + * + * @param User $subscriber + * @return SubscriptionEvent + */ + public function setSubscriber(User $subscriber) + { + $this->subscriber = $subscriber; + + return $this; + } + + /** + * Get subscriber + * + * @return User + */ + public function getSubscriber() + { + return $this->subscriber; + } + + /** + * Set author + * + * @param User $author + * @return SubscriptionEvent + */ + public function setAuthor(User $author) + { + $this->author = $author; + + return $this; + } + + /** + * Get author + * + * @return User + */ + public function getAuthor() + { + return $this->author; + } + + /** + * Set action + * + * @param string $action + * @return SubscriptionEvent + */ + public function setAction($action) + { + $this->action = $action; + + return $this; + } + + /** + * Get action + * + * @return string + */ + public function getAction() + { + return $this->action; + } +} diff --git a/src/Skobkin/Bundle/PointToolsBundle/Entity/User.php b/src/Skobkin/Bundle/PointToolsBundle/Entity/User.php index d4edc04..6f9ffb8 100644 --- a/src/Skobkin/Bundle/PointToolsBundle/Entity/User.php +++ b/src/Skobkin/Bundle/PointToolsBundle/Entity/User.php @@ -44,12 +44,27 @@ class User * @ORM\OneToMany(targetEntity="Subscription", mappedBy="subscriber") */ private $subscriptions; + + /** + * @var ArrayCollection + * + * @ORM\OneToMany(targetEntity="SubscriptionEvent", mappedBy="subscriber") + */ + private $newSubscriptionEvents; + + /** + * @var ArrayCollection + * @ORM\OneToMany(targetEntity="SubscriptionEvent", mappedBy="author") + */ + private $newSubscriberEvents; public function __construct() { $this->subscribers = new ArrayCollection(); $this->subscriptions = new ArrayCollection(); + $this->newSubscriberEvents = new ArrayCollection(); + $this->newSubscriptionEvents = new ArrayCollection(); } /** @@ -150,4 +165,70 @@ class User { return $this->subscriptions; } + + /** + * Add newSubscriptionEvents + * + * @param SubscriptionEvent $newSubscriptionEvents + * @return User + */ + public function addNewSubscriptionEvent(SubscriptionEvent $newSubscriptionEvents) + { + $this->newSubscriptionEvents[] = $newSubscriptionEvents; + + return $this; + } + + /** + * Remove newSubscriptionEvents + * + * @param SubscriptionEvent $newSubscriptionEvents + */ + public function removeNewSubscriptionEvent(SubscriptionEvent $newSubscriptionEvents) + { + $this->newSubscriptionEvents->removeElement($newSubscriptionEvents); + } + + /** + * Get newSubscriptionEvents + * + * @return ArrayCollection + */ + public function getNewSubscriptionEvents() + { + return $this->newSubscriptionEvents; + } + + /** + * Add newSubscriberEvents + * + * @param SubscriptionEvent $newSubscriberEvents + * @return User + */ + public function addNewSubscriberEvent(SubscriptionEvent $newSubscriberEvents) + { + $this->newSubscriberEvents[] = $newSubscriberEvents; + + return $this; + } + + /** + * Remove newSubscriberEvents + * + * @param SubscriptionEvent $newSubscriberEvents + */ + public function removeNewSubscriberEvent(SubscriptionEvent $newSubscriberEvents) + { + $this->newSubscriberEvents->removeElement($newSubscriberEvents); + } + + /** + * Get newSubscriberEvents + * + * @return ArrayCollection + */ + public function getNewSubscriberEvents() + { + return $this->newSubscriberEvents; + } }