*/
private $icon;
+ /**
+ * @var bool
+ * Has this message been suppressed?
+ */
+ private $isVisible;
+
/**
* @var bool|string
* Date this message is hidden until
}
/**
- * Return message visibility.
+ * Get message visibility.
*
* @return bool
*/
public function isVisible() {
- return !$this->checkStatusPreference();
+ if (!isset($this->isVisible)) {
+ $this->isVisible = !$this->checkStatusPreference();
+ }
+ return $this->isVisible;
}
/**
+ * Get date hidden until.
+ *
* @return string
*/
public function getHiddenUntil() {
/**
* Check if message is visible or has been hidden by the user.
*
+ * Also populates this->hiddenUntil property.
+ *
* @return bool
* TRUE means hidden, FALSE means visible.
* @throws \CiviCRM_API3_Exception