当前位置: 首页>>代码示例>>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;未经允许,请勿转载。