本文整理汇总了PHP中eZURLAliasML::removeSingleEntry方法的典型用法代码示例。如果您正苦于以下问题:PHP eZURLAliasML::removeSingleEntry方法的具体用法?PHP eZURLAliasML::removeSingleEntry怎么用?PHP eZURLAliasML::removeSingleEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZURLAliasML
的用法示例。
在下文中一共展示了eZURLAliasML::removeSingleEntry方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$filter->prepare();
}
$infoCode = "feedback-removed-all";
} else {
if ($Module->isCurrentAction('RemoveAlias')) {
if ($http->hasPostVariable('ElementList')) {
$elementList = $http->postVariable('ElementList');
if (!is_array($elementList)) {
$elementList = array();
}
foreach ($elementList as $element) {
if (preg_match("#^([0-9]+).([a-fA-F0-9]+).([a-zA-Z0-9-]+)\$#", $element, $matches)) {
$parentID = (int) $matches[1];
$textMD5 = $matches[2];
$language = $matches[3];
eZURLAliasML::removeSingleEntry($parentID, $textMD5, $language);
}
}
$infoCode = "feedback-removed";
}
} else {
if ($Module->isCurrentAction('NewAlias')) {
$aliasText = trim($Module->actionParameter('AliasText'));
$parentIsRoot = false;
if ($http->hasPostVariable('ParentIsRoot') && strlen(trim($http->postVariable('ParentIsRoot'))) > 0) {
$parentIsRoot = true;
}
$languageCode = $Module->actionParameter('LanguageCode');
$language = eZContentLanguage::fetchByLocale($languageCode);
$aliasRedirects = $http->hasPostVariable('AliasRedirects') && $http->postVariable('AliasRedirects');
if (!$language) {
示例2: removeTranslation
//.........这里部分代码省略.........
if ( $objectInitialLanguageID == $languageID )
{
return false;
}
// change language_mask of the object
$languageMask = (int) $this->attribute( 'language_mask' );
$languageMask = (int) $languageMask & ~ (int) $languageID;
$this->setAttribute( 'language_mask', $languageMask );
$db = eZDB::instance();
$db->begin();
$this->store();
$objectID = $this->ID;
// If the current version has initial_language_id $languageID, change it to the initial_language_id of the object.
$currentVersion = $this->currentVersion();
if ( $currentVersion->attribute( 'initial_language_id' ) == $languageID )
{
$currentVersion->setAttribute( 'initial_language_id', $objectInitialLanguageID );
$currentVersion->store();
}
// Remove all versions which had the language as its initial ID. Because of previous checks, it is sure we will not remove the published version.
$versionsToRemove = $this->versions( true, array( 'conditions' => array( 'initial_language_id' => $languageID ) ) );
foreach ( $versionsToRemove as $version )
{
$version->removeThis();
}
$altLanguageID = $languageID++;
// Remove all attributes in the language
$attributes = $db->arrayQuery( "SELECT * FROM ezcontentobject_attribute
WHERE contentobject_id='$objectID'
AND ( language_id='$languageID' OR language_id='$altLanguageID' )" );
foreach ( $attributes as $attribute )
{
$attributeObject = new eZContentObjectAttribute( $attribute );
$attributeObject->remove( $attributeObject->attribute( 'id' ), $attributeObject->attribute( 'version' ) );
unset( $attributeObject );
}
// Remove all names in the language
$db->query( "DELETE FROM ezcontentobject_name
WHERE contentobject_id='$objectID'
AND ( language_id='$languageID' OR language_id='$altLanguageID' )" );
// Update masks of the objects
$mask = eZContentLanguage::maskForRealLanguages() - (int) $languageID;
if ( $db->databaseName() == 'oracle' )
{
$db->query( "UPDATE ezcontentobject_version SET language_mask = bitand( language_mask, $mask )
WHERE contentobject_id='$objectID'" );
}
else
{
$db->query( "UPDATE ezcontentobject_version SET language_mask = language_mask & $mask
WHERE contentobject_id='$objectID'" );
}
$urlElementfilter = new eZURLAliasQuery();
$urlElementfilter->type = 'name';
// We want all languages present here, so we are turning off
// language filtering
$urlElementfilter->languages = false;
$urlElementfilter->limit = false;
$nodes = $this->assignedNodes();
foreach ( $nodes as $node )
{
$parent = null;
$textMD5 = null;
$urlElementfilter->actions = array( 'eznode:' . $node->attribute( 'node_id' ) );
$urlElementfilter->prepare();
$urlElements = $urlElementfilter->fetchAll();
foreach ($urlElements as $url )
{
if ( $url->attribute( 'lang_mask' ) === (int)$languageID or
$url->attribute( 'lang_mask') === (int)$altLanguageID )
{
$parent = $url->attribute( 'parent');
$textMD5 = $url->attribute( 'text_md5' );
break;
}
}
if ( $parent !== null and $textMD5 !== null )
eZURLAliasML::removeSingleEntry( $parent, $textMD5, $language );
}
$db->commit();
return true;
}