Created
August 28, 2016 00:56
-
-
Save jm42/cbd91d0ae6c004cd2290b643108ea80f to your computer and use it in GitHub Desktop.
[Unfinished] `ForumBundle` entities
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 Argon\MessageBundle\Entity; | |
use Argon\GameBundle\Entity\Character as Creator; | |
use Argon\GameBundle\Provider\GameProviderInterface; | |
use Argon\GameBundle\Provider\GameProviderTrait; | |
/** | |
* Forum contains topics | |
*/ | |
class Forum implements GameProviderInterface | |
{ | |
use GameProviderTrait; | |
/** | |
* @var integer | |
*/ | |
protected $id; | |
/** | |
* @var \Argon\GameBundle\Entity\Character | |
*/ | |
protected $creator; | |
/** | |
* @var string | |
*/ | |
protected $slug; | |
/** | |
* @var string | |
*/ | |
protected $name; | |
/** | |
* @var string | |
*/ | |
protected $description; | |
/** | |
* @var \DateTime | |
*/ | |
protected $createdAt; | |
/** | |
* @var \DateTime | |
*/ | |
protected $modifiedAt; | |
/** | |
* @var \DateTime | |
*/ | |
protected $deletedAt; | |
/** | |
* @var string | |
*/ | |
protected $locale; | |
public function __toString() | |
{ | |
return $this->getName(); | |
} | |
/** | |
* @return integer | |
*/ | |
public function getId() | |
{ | |
return $this->id; | |
} | |
/** | |
* @param \Argon\GameBundle\Entity\Character $creator | |
*/ | |
public function setCreator(Creator $creator) | |
{ | |
$this->creator = $creator; | |
} | |
/** | |
* @return \Argon\GameBundle\Entity\Character | |
*/ | |
public function getCreator() | |
{ | |
return $this->creator; | |
} | |
/** | |
* @return string | |
*/ | |
public function getSlug() | |
{ | |
return $this->slug; | |
} | |
/** | |
* @param string $name | |
*/ | |
public function setName($name) | |
{ | |
$this->name = $name; | |
} | |
/** | |
* @return string | |
*/ | |
public function getName() | |
{ | |
return $this->name; | |
} | |
/** | |
* @param string $description | |
*/ | |
public function setDescription($description) | |
{ | |
$this->description = $description; | |
} | |
/** | |
* @return string | |
*/ | |
public function getDescription() | |
{ | |
return $this->description; | |
} | |
/** | |
* @return \DateTime | |
*/ | |
public function getCreatedAt() | |
{ | |
return $this->createdAt; | |
} | |
/** | |
* @return \DateTime | |
*/ | |
public function getModifiedAt() | |
{ | |
return $this->modifiedAt; | |
} | |
/** | |
* @return \DateTime | |
*/ | |
public function getDeletedAt() | |
{ | |
return $this->deletedAt; | |
} | |
/** | |
* @param string $locale | |
*/ | |
public function setTranslatableLocale($locale) | |
{ | |
$this->locale = $locale; | |
} | |
} |
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 Argon\MessageBundle\Entity; | |
use Argon\GameBundle\Entity\Character as Subscriber; | |
/** | |
* Forum subscribers | |
*/ | |
class ForumSubscriber | |
{ | |
/** | |
* @var integer | |
*/ | |
protected $id; | |
/** | |
* @var \Argon\MessageBundle\Entity\Forum | |
*/ | |
protected $forum; | |
/** | |
* @var \Argon\GameBundle\Entity\Character | |
*/ | |
protected $subscriber; | |
/** | |
* @var \DateTime | |
*/ | |
protected $subscribedAt; | |
/** | |
* @var \DateTime | |
*/ | |
protected $unsubscribedAt; | |
/** | |
* @return integer | |
*/ | |
public function getId() | |
{ | |
return $this->id; | |
} | |
/** | |
* @param \Argon\MessageBundle\Entity\Forum $forum | |
*/ | |
public function setForum(Forum $forum) | |
{ | |
$this->forum = $forum; | |
} | |
/** | |
* @return \Argon\MessageBundle\Entity\Forum | |
*/ | |
public function getForum() | |
{ | |
return $this->forum; | |
} | |
/** | |
* @param \Argon\GameBundle\Entity\Character $subscriber | |
*/ | |
public function setSubscriber(Subscriber $subscriber) | |
{ | |
$this->subscriber = $subscriber; | |
} | |
/** | |
* @return \Argon\GameBundle\Entity\Character | |
*/ | |
public function getSubscriber() | |
{ | |
return $this->subscriber; | |
} | |
/** | |
* @return \DateTime | |
*/ | |
public function getSubscribedAt() | |
{ | |
return $this->subscribedAt; | |
} | |
/** | |
* @return \DateTime | |
*/ | |
public function getUnsubscribedAt() | |
{ | |
return $this->unsubscribedAt; | |
} | |
} |
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 Argon\MessageBundle\Entity; | |
use FOS\Message\Model\Message; | |
use Argon\GameBundle\Entity\Character as Sender; | |
class Post extends Message | |
{ | |
/** | |
* @param \Argon\MessageBundle\Entity\Topic $topic | |
* @param \Argon\GameBundle\Entity\Character $sender | |
* @param string $body | |
*/ | |
public function __construct(Topic $topic, Sender $sender, $body) | |
{ | |
parent::__construct($topic, $sender, $body); | |
} | |
/** | |
* @return \Argon\MessageBundle\Entity\Topic | |
*/ | |
public function getTopic() | |
{ | |
return $this->getConversation(); | |
} | |
} |
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 Argon\MessageBundle\Entity; | |
use FOS\Message\Model\MessagePerson; | |
use Argon\GameBundle\Entity\Character as Reader; | |
class PostReader extends MessagePerson | |
{ | |
/** | |
* @var integer | |
*/ | |
protected $id; | |
/** | |
* @param \Argon\MessageBundle\Entity\Post $post | |
* @param \Argon\GameBundle\Entity\Character $reader | |
*/ | |
public function __construct(Post $post, Reader $reader) | |
{ | |
parent::__construct($post, $reader); | |
} | |
/** | |
* @return integer | |
*/ | |
public function getId() | |
{ | |
return $this->id; | |
} | |
/** | |
* @return \Argon\MessageBundle\Entity\Post | |
*/ | |
public function getPost() | |
{ | |
return $this->getMessage(); | |
} | |
/** | |
* @return \Argon\GameBundle\Entity\Character | |
*/ | |
public function getReader() | |
{ | |
return $this->getPerson(); | |
} | |
} |
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 Argon\MessageBundle\Entity; | |
use FOS\Message\Model\Conversation; | |
/** | |
* Topic contains posts | |
*/ | |
class Topic extends Conversation | |
{ | |
/** | |
* @var \Argon\MessageBundle\Entity\Forum | |
*/ | |
protected $forum; | |
/** | |
* @var boolean | |
*/ | |
protected $sticky = false; | |
/** | |
* @var \DateTime | |
*/ | |
protected $createdAt; | |
/** | |
* @var \DateTime | |
*/ | |
protected $modifiedAt; | |
/** | |
* @var \DateTime | |
*/ | |
protected $deletedAt; | |
public function __toString() | |
{ | |
return $this->getSubject(); | |
} | |
/** | |
* @param \Argon\MessageBundle\Entity\Forum $forum | |
*/ | |
public function setForum(Forum $forum) | |
{ | |
$this->forum = $forum; | |
} | |
/** | |
* @return \Argon\MessageBundle\Entity\Forum | |
*/ | |
public function getForum() | |
{ | |
return $this->forum; | |
} | |
public function setSticky() | |
{ | |
$this->sticky = true; | |
} | |
public function setNotSticky() | |
{ | |
$this->sticky = false; | |
} | |
/** | |
* @return boolean | |
*/ | |
public function isSticky() | |
{ | |
return $this->sticky; | |
} | |
/** | |
* @return \DateTime | |
*/ | |
public function getCreatedAt() | |
{ | |
return $this->createdAt; | |
} | |
/** | |
* @return \DateTime | |
*/ | |
public function getModifiedAt() | |
{ | |
return $this->modifiedAt; | |
} | |
/** | |
* @return \DateTime | |
*/ | |
public function getDeletedAt() | |
{ | |
return $this->deletedAt; | |
} | |
} |
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 Argon\MessageBundle\Entity; | |
use FOS\Message\Model\ConversationPerson; | |
use Argon\GameBundle\Entity\Character as Subscriber; | |
class TopicSubscriber extends ConversationPerson | |
{ | |
/** | |
* @var integer | |
*/ | |
protected $id; | |
/** | |
* @var \DateTime | |
*/ | |
protected $subscribedAt; | |
/** | |
* @var \DateTime | |
*/ | |
protected $unsubscribedAt; | |
/** | |
* @param \Argon\MessageBundle\Entity\Topic $topic | |
* @param \Argon\GameBundle\Entity\Character $subscriber | |
*/ | |
public function __construct(Topic $topic, Subscriber $subscriber) | |
{ | |
parent::__construct($topic, $subscriber); | |
} | |
/** | |
* @return integer | |
*/ | |
public function getId() | |
{ | |
return $this->id; | |
} | |
/** | |
* @param \Argon\MessageBundle\Entity\Topic $topic | |
*/ | |
public function setTopic(Topic $topic) | |
{ | |
$this->setConversation($topic); | |
} | |
/** | |
* @return \Argon\MessageBundle\Entity\Topic | |
*/ | |
public function getTopic() | |
{ | |
return $this->getConversation(); | |
} | |
/** | |
* @param \Argon\GameBundle\Entity\Character $subscriber | |
*/ | |
public function setSubscriber(Subscriber $subscriber) | |
{ | |
$this->setPerson($subscriber); | |
} | |
/** | |
* @return \Argon\GameBundle\Entity\Character | |
*/ | |
public function getSubscriber() | |
{ | |
return $this->getPerson(); | |
} | |
/** | |
* @return \DateTime | |
*/ | |
public function getSubscribedAt() | |
{ | |
return $this->subscribedAt; | |
} | |
/** | |
* @return \DateTime | |
*/ | |
public function getUnsubscribedAt() | |
{ | |
return $this->unsubscribedAt; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment