/** * Determines if this forum (i.e. all topics in it) has been read by the * currently logged in user. * * @param FrontendUser $user The user. * @return boolean TRUE, if all topics in this forum have been read, otherwise FALSE. */ public function hasBeenReadByUser(FrontendUser $user = NULL) { if ($user === NULL || $this->readers === NULL) { return TRUE; } return $this->readers->contains($user); }
/** * Determines whether this topic has been read by a certain user. * * @param FrontendUser $supporter The user who is to be checked. * @return boolean TRUE, if the user did read this topic, otherwise FALSE. */ public function hasBeenSupportedByUser(FrontendUser $supporter = NULL) { return $supporter ? $this->supporters->contains($supporter) : TRUE; }
/** * Determines whether this topic has been read by a certain user. * * @param \Mittwald\Typo3Forum\Domain\Model\User\FrontendUser $reader The user who is to be checked. * * @return boolean TRUE, if the user did read this topic, otherwise FALSE. */ public function hasBeenReadByUser(\Mittwald\Typo3Forum\Domain\Model\User\FrontendUser $reader = NULL) { return $reader ? $this->readers->contains($reader) : TRUE; }