本文整理汇总了PHP中DatabaseObject::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseObject::delete方法的具体用法?PHP DatabaseObject::delete怎么用?PHP DatabaseObject::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DatabaseObject
的用法示例。
在下文中一共展示了DatabaseObject::delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
/**
* @return boolean
*/
public function delete()
{
if (!$this->exists()) {
return false;
}
// Unlink articles
ArticleAuthor::OnAuthorDelete($this->getId());
// Unlink aliases
AuthorAlias::OnAuthorDelete($this->getId());
// Unlink authors
AuthorAssignedType::OnAuthorDelete($this->getId());
// Unlink biographies
AuthorBiography::OnAuthorDelete($this->getId());
// Save author data for logging purposes
$tmpData = $this->m_data;
// Delete row from Authors table.
$result = parent::delete();
if ($result) {
if (function_exists("camp_load_translation_strings")) {
camp_load_translation_strings("api");
}
$logText = getGS('Author #$1 "$2" deleted.',
$tmpData['id'], $tmpData['first_name'] . ' ' . $tmpData['last_name']);
Log::Message($logText, null, 174);
}
return $result;
}
示例2: delete
public function delete()
{
$deleted = parent::delete();
$CampCache = CampCache::singleton();
$CampCache->clear('user');
return $deleted;
}
示例3: delete
public function delete()
{
if (!$this->exists()) {
return false;
}
// Deleting the from from disk path is the most common place for
// something to go wrong, so we do that first.
$file = $this->getStorageLocation();
if (file_exists($file) && is_file($file)) {
unlink($file);
}
// Delete all the references to this image.
ArticleAttachment::OnAttachmentDelete($this->m_data['id']);
// Delete the description
Translation::deletePhrase($this->m_data['fk_description_id']);
$tmpData = $this->m_data;
// Delete the record in the database
$success = parent::delete();
$logtext = getGS('File #$1 "$2" deleted.', $tmpData['id'], $tmpData['file_name']);
Log::Message($logtext, null, 39);
return $success;
} // fn delete
示例4: delete
/**
* Delete this subscription and all cooresponding section subscriptions.
*
* @return boolean
*/
public function delete()
{
global $g_ado_db;
$queryStr = "DELETE FROM SubsSections WHERE IdSubscription=" . $this->m_data['Id'];
$g_ado_db->Execute($queryStr);
$deleted = parent::delete();
return $deleted;
}
示例5: delete
public function delete()
{
if (!$this->exists()) {
return false;
}
// Delete the description
Translation::deletePhrase($this->m_data['fk_description_id']);
// Delete the record in the database
return parent::delete();
}
示例6: delete
public function delete()
{
$database = $this->getDatabase();
$database->transaction();
try {
$this->data->clearAll();
parent::delete();
} catch (Exception $e) {
$database->rollback();
}
$database->commit();
}
示例7: delete
/**
* Delete the language, this will also delete the language files unless
* the parameter specifies otherwise.
*
* @return boolean
*/
public function delete($p_deleteLanguageFiles = true)
{
if (is_link($GLOBALS['g_campsiteDir'] . '/' . $this->getCode() . '.php')) {
unlink($GLOBALS['g_campsiteDir'] . '/' . $this->getCode() . '.php');
}
$tmpData = $this->m_data;
$success = parent::delete();
if ($success) {
CampCache::singleton()->clear('user');
}
return $success;
}
示例8: delete
/**
* Delete the publication and all of its aliases.
*
* @return boolean
*/
public function delete()
{
$aliases = Alias::GetAliases(null, $this->m_data['Id']);
if ($aliases && count($aliases) > 0) {
foreach ($aliases as $alias) {
$alias->delete();
}
}
$tmpData = $this->m_data;
$deleted = parent::delete();
return $deleted;
}
示例9: delete
public function delete()
{
$tmpData = $this->m_data;
$success = parent::delete();
if ($success) {
if (function_exists("camp_load_translation_strings")) {
camp_load_translation_strings("api");
}
$logtext = getGS('Country "$1" ($2) deleted', $tmpData['Name'], $tmpData['Code']);
Log::Message($logtext, null, 134);
}
return $success;
} // fn delete
示例10: delete
/**
* @return boolean
*/
public function delete()
{
if (!$this->exists()) {
return false;
}
// Unlink articles
ArticleAuthor::OnAuthorTypeDelete($this->getId());
// Unlink authors
AuthorAssignedType::OnAuthorTypeDelete($this->getId());
// Delete this author type
$authorType = $this->getName();
$result = parent::delete();
return $result;
}
示例11: delete
public function delete()
{
$articleNumber = $this->getArticleNumber();
$deleted = parent::delete();
if ($deleted) {
if (function_exists("camp_load_translation_strings")) {
camp_load_translation_strings("api");
}
$logtext = getGS('Scheduled action deleted from Article #$1',
$articleNumber);
Log::Message($logtext, null, 37);
}
return $deleted;
} // fn delete
示例12: setObjectStatusAction
public static function setObjectStatusAction(DatabaseObject &$object, $action)
{
if ($action == 'publish') {
$object->sendLive();
$object->save();
} else {
if ($action == 'unpublish') {
$object->sendBackToDraft();
//echo "object sent back to draft";
$object->save();
} else {
if ($action == 'delete') {
$object->delete();
}
}
}
}
示例13: delete
/**
* @return boolean
*/
public function delete()
{
if (!$this->exists()) {
return false;
}
// Unlink articles
ArticleAuthor::OnAuthorDelete($this->getId());
// Unlink aliases
AuthorAlias::OnAuthorDelete($this->getId());
// Unlink authors
AuthorAssignedType::OnAuthorDelete($this->getId());
// Unlink biographies
AuthorBiography::OnAuthorDelete($this->getId());
// Save author data for logging purposes
$tmpData = $this->m_data;
// Delete row from Authors table.
$result = parent::delete();
return $result;
}
示例14: delete
/**
* Delete record from database.
*
* @return boolean
*/
function delete()
{
// Delete record from the database
$deleted = parent::delete();
/*
if ($deleted) {
if (function_exists("camp_load_translation_strings")) {
camp_load_translation_strings("api");
}
$logtext = getGS('Article #$1: "$2" ($3) deleted.',
$this->m_data['Number'], $this->m_data['Name'], $this->getLanguageName())
." (".getGS("Publication")." ".$this->m_data['IdPublication'].", "
." ".getGS("Issue")." ".$this->m_data['NrIssue'].", "
." ".getGS("Section")." ".$this->m_data['NrSection'].")";
Log::Message($logtext, null, 32);
}
*/
$CampCache = CampCache::singleton();
$CampCache->clear('user');
return $deleted;
}
示例15: delete
/**
* Delete the Issue, and optionally all sections and articles contained within it.
* @param boolean $p_deleteSections
* @param boolean $p_deleteArticles
* @return int
* Return the number of articles deleted.
*/
public function delete($p_deleteSections = true, $p_deleteArticles = true)
{
global $g_ado_db;
// Delete all scheduled publishing events
IssuePublish::OnIssueDelete($this->m_data['IdPublication'], $this->m_data['Number'], $this->m_data['IdLanguage']);
$articlesDeleted = 0;
if ($p_deleteSections) {
$sections = Section::GetSections($this->m_data['IdPublication'], $this->m_data['Number'], $this->m_data['IdLanguage']);
foreach ($sections as $section) {
$articlesDeleted += $section->delete($p_deleteArticles);
}
}
$tmpData = $this->m_data;
$success = parent::delete();
if ($success) {
$outputSettingIssues = $this->getOutputSettingIssueService()->findByIssue($tmpData['id']);
foreach ($outputSettingIssues as $outputSet) {
$this->getOutputSettingIssueService()->delete($outputSet);
}
}
return $articlesDeleted;
}