本文整理匯總了PHP中Translation::deletePhrase方法的典型用法代碼示例。如果您正苦於以下問題:PHP Translation::deletePhrase方法的具體用法?PHP Translation::deletePhrase怎麽用?PHP Translation::deletePhrase使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Translation
的用法示例。
在下文中一共展示了Translation::deletePhrase方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: 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
示例2: 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();
}
示例3: delete
/**
* Deletes the current article type field.
*/
public function delete()
{
global $g_ado_db;
if (!$this->exists()) {
return false;
}
$oldFieldName = $this->m_data['field_name'];
$typeName = $this->m_data['type_name'];
$typeType = $this->getType();
$orders = $this->getOrders();
$translation = new Translation(null, $this->getPhraseId());
$translation->deletePhrase();
$success = false;
if ($this->getPrintName() != 'NULL') {
$queryStr = "ALTER TABLE `X" . $this->m_data['type_name'] . "` DROP COLUMN `" . $this->getName() . "`";
$success = $g_ado_db->Execute($queryStr);
}
if ($success || $this->getPrintName() == 'NULL') {
$myType = $this->getType();
if ($myType == self::TYPE_TOPIC) {
$queryStr = "DELETE FROM TopicFields WHERE ArticleType = " . $g_ado_db->escape($this->m_data['type_name']) . " and FieldName = " . $g_ado_db->escape($this->m_data['field_name']);
$g_ado_db->Execute($queryStr);
$this->m_rootTopicId = null;
}
$fieldName = $this->m_data['field_name'];
$success = parent::delete();
}
if ($success) {
if ($typeType == self::TYPE_COMPLEX_DATE) {
$em = Zend_Registry::get('container')->getService('em');
$repo = $em->getRepository('Newscoop\\Entity\\ArticleDatetime');
$repo->deleteField($typeName, array('old' => $oldFieldName));
}
}
// reorder
if ($success) {
$newOrders = array();
foreach ($orders as $k => $v) {
if (array_key_exists('field_name', $this->m_data)) {
if ($v != $this->m_data['field_name']) {
$newOrders[] = $v;
}
}
}
$newOrders = array_reverse($newOrders);
$this->setOrders($newOrders);
CampCache::singleton()->clear('user');
}
return $success;
}
示例4: delete
/**
* Deletes the current article type field.
*/
public function delete()
{
global $g_ado_db;
if (!$this->exists()) {
return false;
}
$orders = $this->getOrders();
$translation = new Translation(null, $this->getPhraseId());
$translation->deletePhrase();
if ($this->getPrintName() != 'NULL') {
$queryStr = "ALTER TABLE `X" . $this->m_data['type_name']
. "` DROP COLUMN `" . $this->getName() . "`";
$success = $g_ado_db->Execute($queryStr);
}
if ($success || $this->getPrintName() == 'NULL') {
$myType = $this->getType();
if ($myType == self::TYPE_TOPIC) {
$queryStr = "DELETE FROM TopicFields WHERE ArticleType = '"
. $g_ado_db->escape($this->m_data['type_name']) . "' and FieldName = '"
. $g_ado_db->escape($this->m_data['field_name']) . "'";
$g_ado_db->Execute($queryStr);
$this->m_rootTopicId = null;
}
$fieldName = $this->m_data['field_name'];
$success = parent::delete();
}
// reorder
if ($success) {
$newOrders = array();
foreach ($orders as $k => $v) {
if ($v != $this->m_data['field_name'])
$newOrders[] = $v;
}
$newOrders = array_reverse($newOrders);
$this->setOrders($newOrders);
if (function_exists("camp_load_translation_strings")) {
camp_load_translation_strings("api");
}
$logtext = getGS('Article type field "$1" deleted', $fieldName);
Log::Message($logtext, null, 72);
CampCache::singleton()->clear('user');
}
return $success;
} // fn delete
示例5: delete
/**
* Delete the article type. This will delete the entire table
* in the database. Not recommended unless there is no article
* data in the table.
*/
public function delete()
{
global $g_ado_db;
$translation = new Translation(null, $this->m_metadata->getPhraseId());
$translation->deletePhrase();
foreach ($this->m_dbColumns as $field) {
$field->delete();
}
$this->m_metadata->delete();
$queryStr = "DROP TABLE `" . $this->m_dbTableName . "`";
$success = $g_ado_db->Execute($queryStr);
CampCache::singleton()->clear('user');
}
示例6: delete
/**
* Delete the article type. This will delete the entire table
* in the database. Not recommended unless there is no article
* data in the table.
*/
public function delete()
{
global $g_ado_db;
$translation = new Translation(null, $this->m_metadata->getPhraseId());
$translation->deletePhrase();
foreach ($this->m_dbColumns as $field) {
$field->delete();
}
$this->m_metadata->delete();
$queryStr = "DROP TABLE `" . $this->m_dbTableName . "`";
$success = $g_ado_db->Execute($queryStr);
CampCache::singleton()->clear('user');
if ($success) {
if (function_exists("camp_load_translation_strings")) {
camp_load_translation_strings("api");
}
$logtext = getGS('The article type "$1" has been deleted.', $this->m_name);
Log::Message($logtext, null, 62);
}
} // fn delete