當前位置: 首頁>>代碼示例>>PHP>>正文


PHP StorageInterface::delete方法代碼示例

本文整理匯總了PHP中Drupal\Core\Config\StorageInterface::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP StorageInterface::delete方法的具體用法?PHP StorageInterface::delete怎麽用?PHP StorageInterface::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Drupal\Core\Config\StorageInterface的用法示例。


在下文中一共展示了StorageInterface::delete方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: delete

 /**
  * {@inheritdoc}
  */
 public function delete($name)
 {
     if (isset($this->replacementData[$this->collection][$name])) {
         unset($this->replacementData[$this->collection][$name]);
     }
     return $this->storage->delete($name);
 }
開發者ID:aWEBoLabs,項目名稱:taxi,代碼行數:10,代碼來源:StorageReplaceDataWrapper.php

示例2: delete

 /**
  * {@inheritdoc}
  */
 public function delete($name)
 {
     // If the cache was the first to be deleted, another process might start
     // rebuilding the cache before the storage is gone.
     if ($this->storage->delete($name)) {
         $this->cache->delete($this->getCacheKey($name));
         $this->findByPrefixCache = array();
         return TRUE;
     }
     return FALSE;
 }
開發者ID:ddrozdik,項目名稱:dmaps,代碼行數:14,代碼來源:CachedStorage.php

示例3: delete

 /**
  * {@inheritdoc}
  */
 public function delete($name)
 {
     $doDelete = TRUE;
     foreach ($this->filters as $filter) {
         $doDelete = $filter->filterDelete($doDelete, $name, $this->storage);
     }
     if ($doDelete) {
         return $this->storage->delete($name);
     }
     return TRUE;
 }
開發者ID:gaelg,項目名稱:drush,代碼行數:14,代碼來源:StorageWrapper.php

示例4: delete

 /**
  * Implements Drupal\Core\Config\StorageInterface::delete().
  */
 public function delete($name)
 {
     // If the cache was the first to be deleted, another process might start
     // rebuilding the cache before the storage is gone.
     if ($this->storage->delete($name)) {
         $this->cache->delete($name);
         Cache::deleteTags(array($this::FIND_BY_PREFIX_CACHE_TAG => TRUE));
         $this->findByPrefixCache = array();
         return TRUE;
     }
     return FALSE;
 }
開發者ID:anatalsceo,項目名稱:en-classe,代碼行數:15,代碼來源:CachedStorage.php

示例5: delete

 /**
  * {@inheritdoc}
  */
 public function delete($name)
 {
     return $this->baseStorage->delete($name);
 }
開發者ID:tedbow,項目名稱:scheduled-updates-demo,代碼行數:7,代碼來源:SourceStorage.php

示例6: testCollection

 /**
  * Tests that the storage supports collections.
  */
 public function testCollection()
 {
     $name = 'config_test.storage';
     $data = array('foo' => 'bar');
     $result = $this->storage->write($name, $data);
     $this->assertIdentical($result, TRUE);
     $this->assertIdentical($data, $this->storage->read($name));
     // Create configuration in a new collection.
     $new_storage = $this->storage->createCollection('collection.sub.new');
     $this->assertFalse($new_storage->exists($name));
     $this->assertEqual(array(), $new_storage->listAll());
     $new_storage->write($name, $data);
     $this->assertIdentical($result, TRUE);
     $this->assertIdentical($data, $new_storage->read($name));
     $this->assertEqual(array($name), $new_storage->listAll());
     $this->assertTrue($new_storage->exists($name));
     $new_data = array('foo' => 'baz');
     $new_storage->write($name, $new_data);
     $this->assertIdentical($result, TRUE);
     $this->assertIdentical($new_data, $new_storage->read($name));
     // Create configuration in another collection.
     $another_storage = $this->storage->createCollection('collection.sub.another');
     $this->assertFalse($another_storage->exists($name));
     $this->assertEqual(array(), $another_storage->listAll());
     $another_storage->write($name, $new_data);
     $this->assertIdentical($result, TRUE);
     $this->assertIdentical($new_data, $another_storage->read($name));
     $this->assertEqual(array($name), $another_storage->listAll());
     $this->assertTrue($another_storage->exists($name));
     // Create configuration in yet another collection.
     $alt_storage = $this->storage->createCollection('alternate');
     $alt_storage->write($name, $new_data);
     $this->assertIdentical($result, TRUE);
     $this->assertIdentical($new_data, $alt_storage->read($name));
     // Switch back to the collection-less mode and check the data still exists
     // add has not been touched.
     $this->assertIdentical($data, $this->storage->read($name));
     // Check that the getAllCollectionNames() method works.
     $this->assertIdentical(array('alternate', 'collection.sub.another', 'collection.sub.new'), $this->storage->getAllCollectionNames());
     // Check that the collections are removed when they are empty.
     $alt_storage->delete($name);
     $this->assertIdentical(array('collection.sub.another', 'collection.sub.new'), $this->storage->getAllCollectionNames());
     // Create configuration in collection called 'collection'. This ensures that
     // FileStorage's collection storage works regardless of its use of
     // subdirectories.
     $parent_storage = $this->storage->createCollection('collection');
     $this->assertFalse($parent_storage->exists($name));
     $this->assertEqual(array(), $parent_storage->listAll());
     $parent_storage->write($name, $new_data);
     $this->assertIdentical($result, TRUE);
     $this->assertIdentical($new_data, $parent_storage->read($name));
     $this->assertEqual(array($name), $parent_storage->listAll());
     $this->assertTrue($parent_storage->exists($name));
     $this->assertIdentical(array('collection', 'collection.sub.another', 'collection.sub.new'), $this->storage->getAllCollectionNames());
     $parent_storage->deleteAll();
     $this->assertIdentical(array('collection.sub.another', 'collection.sub.new'), $this->storage->getAllCollectionNames());
     // Check that the having an empty collection-less storage does not break
     // anything. Before deleting check that the previous delete did not affect
     // data in another collection.
     $this->assertIdentical($data, $this->storage->read($name));
     $this->storage->delete($name);
     $this->assertIdentical(array('collection.sub.another', 'collection.sub.new'), $this->storage->getAllCollectionNames());
 }
開發者ID:ddrozdik,項目名稱:dmaps,代碼行數:66,代碼來源:ConfigStorageTestBase.php


注:本文中的Drupal\Core\Config\StorageInterface::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。