Pimcore\Model\Document\Listing::setUnpublished PHP Method

setUnpublished() public method

Set the unpublished flag for the document.
public setUnpublished ( $unpublished ) : boolean
return boolean
    public function setUnpublished($unpublished)
    {
        $this->unpublished = (bool) $unpublished;
        return $this;
    }

Usage Example

 /**
  * Get a list of the sibling documents
  *
  * @param bool $unpublished
  * @return array
  */
 public function getSiblings($unpublished = false)
 {
     if ($this->siblings === null) {
         $list = new Document\Listing();
         $list->setUnpublished($unpublished);
         // string conversion because parentId could be 0
         $list->addConditionParam("parentId = ?", (string) $this->getParentId());
         $list->addConditionParam("id != ?", $this->getId());
         $list->setOrderKey("index");
         $list->setOrder("asc");
         $this->siblings = $list->load();
     }
     return $this->siblings;
 }
All Usage Examples Of Pimcore\Model\Document\Listing::setUnpublished