Neos\ContentRepository\Domain\Model\NodeData::isVisible PHP Метод

isVisible() публичный Метод

For this the "hidden" flag and the "hiddenBeforeDateTime" and "hiddenAfterDateTime" dates are taken into account. The fact that a node is "visible" does not imply that it can / may be shown to the user. Further modifiers such as isAccessible() need to be evaluated.
public isVisible ( ) : boolean
Результат boolean
    public function isVisible()
    {
        if ($this->hidden === true) {
            return false;
        }
        return true;
    }

Usage Example

Пример #1
0
 /**
  * Tells if this node is "visible".
  *
  * For this the "hidden" flag and the "hiddenBeforeDateTime" and "hiddenAfterDateTime" dates are
  * taken into account.
  *
  * @return boolean
  * @api
  */
 public function isVisible()
 {
     if ($this->nodeData->isVisible() === false) {
         return false;
     }
     $currentDateTime = $this->context->getCurrentDateTime();
     if ($this->getHiddenBeforeDateTime() !== null && $this->getHiddenBeforeDateTime() > $currentDateTime) {
         return false;
     }
     if ($this->getHiddenAfterDateTime() !== null && $this->getHiddenAfterDateTime() < $currentDateTime) {
         return false;
     }
     return true;
 }