本文整理汇总了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 "";
}
示例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();
}
}
}
}
}
示例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;
}
示例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();
}
}
}
}
示例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;
}
示例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;
}
示例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}();
}
}
}
}