unpublishedat && $this->publishedat->getTimestamp() <= $today->getTimestamp() ) { return true; } if ( $this->publishedat->getTimestamp() <= $today->getTimestamp() && $this->unpublishedat->getTimestamp() >= $today->getTimestamp() ) { return true; } return false; } // IsPending public function isPending() { $today = new \DateTime(); if ($this->publishedat->getTimestamp() > $today->getTimestamp()) { return true; } return false; } // IsArchived public function isArchived() { $today = new \DateTime(); if (null === $this->unpublishedat) { return false; } if ($this->unpublishedat->getTimestamp() < $today->getTimestamp()) { return true; } return false; } /** * Constructor. */ public function __construct() { $this->groups = new \Doctrine\Common\Collections\ArrayCollection(); $this->readers = new ArrayCollection(); } /** * Get id. * * @return int */ public function getId() { return $this->id; } /** * Set title. * * @param string $title * * @return Alert */ public function setTitle($title) { $this->title = $title; return $this; } /** * Get title. * * @return string */ public function getTitle() { return $this->title; } /** * Set content. * * @param string $content * * @return Alert */ public function setContent($content) { $this->content = $content; return $this; } /** * Get content. * * @return string */ public function getContent() { return $this->content; } /** * Set rowOrder. * * @param int $rowOrder * * @return Alert */ public function setRowOrder($rowOrder) { $this->rowOrder = $rowOrder; return $this; } /** * Get rowOrder. * * @return int */ public function getRowOrder() { return $this->rowOrder; } /** * Set publishedat. * * @param \DateTime $publishedat * * @return Alert */ public function setpublishedat($publishedat) { $this->publishedat = $publishedat; return $this; } /** * Get publishedat. * * @return \DateTime */ public function getpublishedat() { return $this->publishedat; } /** * Set unpublishedat. * * @param \DateTime $unpublishedat * * @return Alert */ public function setUnpublishedat($unpublishedat) { $this->unpublishedat = $unpublishedat; return $this; } /** * Get unpublishedat. * * @return \DateTime */ public function getUnpublishedat() { return $this->unpublishedat; } /** * Set roles. * * @param array $roles * * @return Alert */ public function setRoles($roles) { $this->roles = $roles; return $this; } /** * Get roles. * * @return array */ public function getRoles() { return $this->roles; } /** * Set alertcategory. * * @return Alert */ public function setAlertcategory(Alertcategory $alertcategory) { $this->alertcategory = $alertcategory; return $this; } /** * Get alertcategory. * * @return Alertcategory */ public function getAlertcategory() { return $this->alertcategory; } /** * Add group. * * @return Alert */ public function addGroup(Group $group) { $this->groups[] = $group; return $this; } /** * Remove group. */ public function removeGroup(Group $group) { $this->groups->removeElement($group); } /** * Get groups. * * @return \Doctrine\Common\Collections\Collection */ public function getGroups() { return $this->groups; } /** * Set fghideable. * * @param bool $fghideable * * @return Alert */ public function setFghideable($fghideable) { $this->fghideable = $fghideable; return $this; } /** * Get fghideable. * * @return bool */ public function getFghideable() { return $this->fghideable; } /** * Add reader. * * @return Alert */ public function addReader(User $reader) { $this->readers[] = $reader; return $this; } /** * Remove reader. */ public function removeReader(User $reader) { $this->readers->removeElement($reader); } /** * Get readers. * * @return \Doctrine\Common\Collections\Collection */ public function getReaders() { return $this->readers; } public function isFghideable(): ?bool { return $this->fghideable; } }