本文整理汇总了PHP中Pimcore_Tool::isValidKey方法的典型用法代码示例。如果您正苦于以下问题:PHP Pimcore_Tool::isValidKey方法的具体用法?PHP Pimcore_Tool::isValidKey怎么用?PHP Pimcore_Tool::isValidKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pimcore_Tool
的用法示例。
在下文中一共展示了Pimcore_Tool::isValidKey方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
/**
* Saves the document
*
* @return void
*/
public function save()
{
if (!Pimcore_Tool::isValidKey($this->getKey())) {
throw new Exception("invalid key for object with id [ " . $this->getId() . " ]");
}
$this->correctPath();
// set date
$this->setModificationDate(time());
if ($this->getId()) {
$this->update();
} else {
Pimcore_API_Plugin_Broker::getInstance()->preAddDocument($this);
$this->getResource()->create();
Pimcore_API_Plugin_Broker::getInstance()->postAddDocument($this);
$this->update();
}
}
示例2: save
/**
* @return void
*/
public function save()
{
if (!Pimcore_Tool::isValidKey($this->getKey())) {
throw new Exception("invalid filname '" . $this->getKey() . "' for asset with id [ " . $this->getId() . " ]");
}
$this->correctPath();
if ($this->getId()) {
$this->update();
} else {
$this->getResource()->create();
Pimcore_API_Plugin_Broker::getInstance()->postAddAsset($this);
$this->update();
}
}
示例3: save
/**
* @return void
*/
public function save()
{
// be sure that unpublished objects in relations are saved also in frontend mode, eg. in importers, ...
$hideUnpublishedBackup = self::getHideUnpublished();
self::setHideUnpublished(false);
if (!Pimcore_Tool::isValidKey($this->getKey())) {
throw new Exception("invalid key for object with id [ " . $this->getId() . " ]");
}
$this->correctPath();
if ($this->getO_Id()) {
$this->update();
} else {
Pimcore_API_Plugin_Broker::getInstance()->preAddObject($this);
$this->getResource()->create();
Pimcore_API_Plugin_Broker::getInstance()->postAddObject($this);
$this->update();
}
self::setHideUnpublished($hideUnpublishedBackup);
}