本文整理匯總了PHP中Key::getError方法的典型用法代碼示例。如果您正苦於以下問題:PHP Key::getError方法的具體用法?PHP Key::getError怎麽用?PHP Key::getError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Key
的用法示例。
在下文中一共展示了Key::getError方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: saveKey
public function saveKey($new_folder = true)
{
if (empty($this->key_id)) {
$key = new Key();
} else {
$key = new Key($this->key_id);
if (PHPWS_Error::isError($key->getError())) {
$key = new Key();
}
}
$key->setModule('filecabinet');
$key->setItemName('folder');
$key->setItemId($this->id);
$key->setEditPermission('edit_folders');
$key->setUrl($this->viewLink(false));
$key->setTitle($this->title);
$key->setSummary($this->description);
$result = $key->save();
if (PHPWS_Error::isError($result)) {
return $result;
}
$this->key_id = $key->id;
if ($new_folder) {
$db = new PHPWS_DB('folders');
$db->addWhere('id', $this->id);
$db->addValue('key_id', $this->key_id);
$result = $db->update();
if (PHPWS_Error::isError($result)) {
return $result;
}
}
return true;
}
示例2: saveKey
public function saveKey()
{
if (empty($this->key_id)) {
$key = new Key();
} else {
$key = new Key($this->key_id);
if (PHPWS_Error::isError($key->getError())) {
$key = new Key();
}
}
$key->setModule('calendar');
$key->setItemName('event' . $this->_schedule->id);
$key->setItemId($this->id);
$key->setUrl($this->getViewLink());
$key->setTitle($this->summary);
if (!empty($this->description)) {
$key->setSummary($this->description);
}
$result = $key->save();
if (PHPWS_Error::isError($result)) {
return $result;
}
$this->key_id = $key->id;
return $key;
}
示例3: saveKey
public function saveKey()
{
if (empty($this->key_id)) {
$key = new Key();
} else {
$key = new Key($this->key_id);
if (PHPWS_Error::isError($key->getError())) {
$key = new Key();
}
}
$key->setModule('calendar');
$key->setItemName('schedule');
$key->setItemId($this->id);
if ($this->public) {
$key->restricted = 0;
$key->setEditPermission('edit_public');
} else {
$key->restricted = 2;
$key->setEditPermission('edit_private');
}
$key->setUrl($this->getViewLink(false));
$key->setTitle($this->title);
$key->setSummary($this->summary);
$result = $key->save();
$this->key_id = $key->id;
return $result;
}
示例4: saveKey
public function saveKey()
{
if (empty($this->key_id)) {
$key = new Key();
} else {
$key = new Key($this->key_id);
if (PHPWS_Error::isError($key->getError())) {
$key = new Key();
}
}
$key->setModule('blog');
$key->setItemName('entry');
$key->setItemId($this->id);
$key->setEditPermission('edit_blog');
$key->setUrl($this->getViewLink(true));
$key->setTitle($this->title);
$key->setShowAfter($this->publish_date);
$key->setHideAfter($this->expire_date);
if (!empty($this->summary)) {
$key->setSummary($this->summary);
} else {
$key->setSummary($this->entry);
}
$key->save();
$this->key_id = $key->id;
return $key;
}