當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Document::doHideUnpublished方法代碼示例

本文整理匯總了PHP中Pimcore\Model\Document::doHideUnpublished方法的典型用法代碼示例。如果您正苦於以下問題:PHP Document::doHideUnpublished方法的具體用法?PHP Document::doHideUnpublished怎麽用?PHP Document::doHideUnpublished使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Pimcore\Model\Document的用法示例。


在下文中一共展示了Document::doHideUnpublished方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getCondition

 protected function getCondition()
 {
     if ($cond = $this->model->getCondition()) {
         if (Document::doHideUnpublished() && !$this->model->getUnpublished()) {
             return " WHERE (" . $cond . ") AND published = 1";
         }
         return " WHERE " . $cond . " ";
     } elseif (Document::doHideUnpublished() && !$this->model->getUnpublished()) {
         return " WHERE published = 1";
     }
     return "";
 }
開發者ID:emanuel-london,項目名稱:pimcore,代碼行數:12,代碼來源:Dao.php

示例2: updatePathFromInternal

 protected function updatePathFromInternal()
 {
     if ($this->data['internal']) {
         if ($this->data['internalType'] == 'document') {
             if ($doc = Document::getById($this->data['internalId'])) {
                 if (!Document::doHideUnpublished() || $doc->isPublished()) {
                     $path = $doc->getFullPath();
                     $this->data['path'] = \Toolbox\Tools\GlobalLink::parse($path);
                 }
             }
         } else {
             if ($this->data['internalType'] == 'asset') {
                 if ($asset = Asset::getById($this->data['internalId'])) {
                     $this->data['path'] = $asset->getFullPath();
                 }
             }
         }
     }
 }
開發者ID:dachcom-digital,項目名稱:pimcore-toolbox,代碼行數:19,代碼來源:Globallink.php

示例3: getFullPath

 /**
  * Returns teh path of the linked element
  *
  * @return mixed
  */
 public function getFullPath()
 {
     $this->setElement();
     //don't give unpublished elements in frontend
     if (Document::doHideUnpublished() and !Element\Service::isPublished($this->element)) {
         return false;
     }
     if ($this->element instanceof Element\ElementInterface) {
         return $this->element->getFullPath();
     }
     return;
 }
開發者ID:yonetici,項目名稱:pimcore-coreshop-demo,代碼行數:17,代碼來源:Href.php

示例4: updatePathFromInternal

 /**
  * 
  */
 protected function updatePathFromInternal()
 {
     if ($this->data["internal"]) {
         if ($this->data["internalType"] == "document") {
             if ($doc = Document::getById($this->data["internalId"])) {
                 if (!Document::doHideUnpublished() || $doc->isPublished()) {
                     $this->data["path"] = $doc->getFullPath();
                 } else {
                     $this->data["path"] = "";
                 }
             }
         } elseif ($this->data["internalType"] == "asset") {
             if ($asset = Asset::getById($this->data["internalId"])) {
                 $this->data["path"] = $asset->getFullPath();
             }
         }
     }
 }
開發者ID:emanuel-london,項目名稱:pimcore,代碼行數:21,代碼來源:Link.php

示例5: getHref

 /**
  * @return string
  */
 public function getHref()
 {
     if ($this->data["internal"]) {
         if ($this->data["internalType"] == "document") {
             if ($doc = Document::getById($this->data["internalId"])) {
                 if (!Document::doHideUnpublished() || $doc->isPublished()) {
                     $this->data["path"] = $doc->getFullPath();
                 } else {
                     $this->data["path"] = "";
                 }
             }
         } else {
             if ($this->data["internalType"] == "asset") {
                 if ($asset = Asset::getById($this->data["internalId"])) {
                     $this->data["path"] = $asset->getFullPath();
                 }
             }
         }
     }
     $url = $this->data["path"];
     if (strlen($this->data["parameters"]) > 0) {
         $url .= "?" . str_replace("?", "", $this->getParameters());
     }
     if (strlen($this->data["anchor"]) > 0) {
         $url .= "#" . str_replace("#", "", $this->getAnchor());
     }
     return $url;
 }
開發者ID:Gerhard13,項目名稱:pimcore,代碼行數:31,代碼來源:Link.php

示例6: getCondition

 /**
  * Returns the SQL condition value.
  *
  * @return string
  */
 public function getCondition()
 {
     $condition = parent::getCondition();
     if ($condition) {
         if (Document::doHideUnpublished() && !$this->getUnpublished()) {
             $condition = " (" . $condition . ") AND published = 1";
         }
     } elseif (Document::doHideUnpublished() && !$this->getUnpublished()) {
         $condition = "published = 1";
     }
     return $condition;
 }
開發者ID:pimcore,項目名稱:pimcore,代碼行數:17,代碼來源:Listing.php

示例7: updatePathFromInternal

 /**
  * @param bool $realPath
  */
 protected function updatePathFromInternal($realPath = false)
 {
     $method = "getFullPath";
     if ($realPath) {
         $method = "getRealFullPath";
     }
     if (isset($this->data["internal"]) && $this->data["internal"]) {
         if ($this->data["internalType"] == "document") {
             if ($doc = Document::getById($this->data["internalId"])) {
                 if (!Document::doHideUnpublished() || $doc->isPublished()) {
                     $this->data["path"] = $doc->{$method}();
                 } else {
                     $this->data["path"] = "";
                 }
             }
         } elseif ($this->data["internalType"] == "asset") {
             if ($asset = Asset::getById($this->data["internalId"])) {
                 $this->data["path"] = $asset->{$method}();
             }
         }
     }
 }
開發者ID:pimcore,項目名稱:pimcore,代碼行數:25,代碼來源:Link.php


注:本文中的Pimcore\Model\Document::doHideUnpublished方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。