本文整理汇总了PHP中eZURLAliasML::removeByAction方法的典型用法代码示例。如果您正苦于以下问题:PHP eZURLAliasML::removeByAction方法的具体用法?PHP eZURLAliasML::removeByAction怎么用?PHP eZURLAliasML::removeByAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZURLAliasML
的用法示例。
在下文中一共展示了eZURLAliasML::removeByAction方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testRemoveByAction
public function testRemoveByAction()
{
$nodeID = mt_rand();
$action = "eznode:{$nodeID}";
$url = eZURLAliasML::create(__FUNCTION__, $action, 1, 2);
$url->store();
$db = eZDB::instance();
$query = "SELECT * from ezurlalias_ml where action = '{$action}'";
// Make sure we have one and only one url
$result = $db->arrayQuery($query);
if (count($result) !== 1) {
self::fail("There was already an url with same action ({$action}) as our test in the database.");
}
// Remove the url and verify that it's gone
eZURLAliasML::removeByAction("eznode", $nodeID);
$result = $db->arrayQuery($query);
self::assertEquals(count($result), 0);
}
示例2: removeThis
function removeThis()
{
$ini = eZINI::instance();
$object = $this->object();
$nodeID = $this->attribute('node_id');
$objectID = $object->attribute('id');
if (eZAudit::isAuditEnabled()) {
// Set audit params.
$objectName = $object->attribute('name');
eZAudit::writeAudit('content-delete', array('Node ID' => $nodeID, 'Object ID' => $objectID, 'Content Name' => $objectName, 'Comment' => 'Removed the current node: eZContentObjectTreeNode::removeNode()'));
}
$db = eZDB::instance();
$db->begin();
$nodePath = $this->attribute('path_string');
$childrensPath = $nodePath;
$pathString = " path_string like '{$childrensPath}%' ";
$urlAlias = $this->attribute('url_alias');
// Remove static cache
if ($ini->variable('ContentSettings', 'StaticCache') == 'enabled') {
$optionArray = array('iniFile' => 'site.ini', 'iniSection' => 'ContentSettings', 'iniVariable' => 'StaticCacheHandler');
$options = new ezpExtensionOptions($optionArray);
$staticCacheHandler = eZExtension::getHandlerClass($options);
$staticCacheHandler->removeURL("/" . $urlAlias);
$staticCacheHandler->generateAlwaysUpdatedCache();
$parent = $this->fetchParent();
}
$db->query("DELETE FROM ezcontentobject_tree\n WHERE {$pathString} OR\n path_string = '{$nodePath}'");
// Re-cache parent node
if ($ini->variable('ContentSettings', 'StaticCache') == 'enabled') {
if ($parent) {
$staticCacheHandler->cacheURL("/" . $parent->urlAlias());
}
}
// Clean up URL alias entries
eZURLAliasML::removeByAction('eznode', $nodeID);
// Clean up content cache
eZContentCacheManager::clearContentCacheIfNeeded($this->attribute('contentobject_id'));
// clean up user cache
if (in_array($object->attribute('contentclass_id'), eZUser::contentClassIDs())) {
eZUser::removeSessionData($objectID);
eZUser::purgeUserCacheByUserId($objectID);
}
$parentNode = $this->attribute('parent');
if (is_object($parentNode)) {
eZContentCacheManager::clearContentCacheIfNeeded($parentNode->attribute('contentobject_id'));
$parentNode->updateAndStoreModified();
eZNodeAssignment::purgeByParentAndContentObjectID($parentNode->attribute('node_id'), $objectID);
}
// Clean up policies and limitations
eZRole::cleanupByNode($this);
// Clean up recent items
eZContentBrowseRecent::removeRecentByNodeID($nodeID);
// Clean up bookmarks
eZContentBrowseBookmark::removeByNodeID($nodeID);
// Clean up tip-a-friend counter
eZTipafriendCounter::removeForNode($nodeID);
// Clean up view counter
eZViewCounter::removeCounter($nodeID);
$db->commit();
}