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


PHP FrontendInterface::remove方法代碼示例

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


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

示例1:

 function it_removes_all_items_by_ids()
 {
     $this->cacheFrontend->remove('prefix_key1')->willReturn(true)->shouldBeCalled();
     $this->cacheFrontend->remove('prefix_key2')->willReturn(true)->shouldBeCalled();
     $this->cacheFrontend->remove('prefix_key3')->willReturn(true)->shouldBeCalled();
     $this->deleteItems(['key1', 'key2', 'key3'])->shouldReturn(true);
 }
開發者ID:ecomdev,項目名稱:magento-psr6-bridge,代碼行數:7,代碼來源:CacheItemPoolSpec.php

示例2: remove

 /**
  * Remove cached data by identifier
  *
  * @param string $identifier
  * @return bool
  */
 public function remove($identifier)
 {
     return $this->_frontend->remove($identifier);
 }
開發者ID:,項目名稱:,代碼行數:10,代碼來源:

示例3: resetDdlCache

 /**
  * Reset cached DDL data from cache
  * if table name is null - reset all cached DDL data
  *
  * @param string $tableName
  * @param string $schemaName OPTIONAL
  * @return $this
  */
 public function resetDdlCache($tableName = null, $schemaName = null)
 {
     if (!$this->_isDdlCacheAllowed) {
         return $this;
     }
     if ($tableName === null) {
         $this->_ddlCache = array();
         if ($this->_cacheAdapter) {
             $this->_cacheAdapter->clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, array(self::DDL_CACHE_TAG));
         }
     } else {
         $cacheKey = $this->_getTableName($tableName, $schemaName);
         $ddlTypes = array(self::DDL_DESCRIBE, self::DDL_CREATE, self::DDL_INDEX, self::DDL_FOREIGN_KEY);
         foreach ($ddlTypes as $ddlType) {
             unset($this->_ddlCache[$ddlType][$cacheKey]);
         }
         if ($this->_cacheAdapter) {
             foreach ($ddlTypes as $ddlType) {
                 $cacheId = $this->_getCacheId($cacheKey, $ddlType);
                 $this->_cacheAdapter->remove($cacheId);
             }
         }
     }
     return $this;
 }
開發者ID:Atlis,項目名稱:docker-magento2,代碼行數:33,代碼來源:Mysql.php

示例4: save

 /**
  * Save configurable product depended data
  *
  * @param \Magento\Catalog\Model\Product $product
  * @return $this
  * @throws \InvalidArgumentException
  * @deprecated the \Magento\ConfigurableProduct\Model\Product\SaveHandler::execute should be used instead
  */
 public function save($product)
 {
     parent::save($product);
     $cacheId = __CLASS__ . $product->getId();
     $this->cache->remove($cacheId);
     $extensionAttributes = $product->getExtensionAttributes();
     // this approach is needed for 3rd-party extensions which are not using extension attributes
     if (empty($extensionAttributes->getConfigurableProductOptions())) {
         $this->saveConfigurableOptions($product);
     }
     if (empty($extensionAttributes->getConfigurableProductLinks())) {
         $this->saveRelatedProducts($product);
     }
     return $this;
 }
開發者ID:BlackIkeEagle,項目名稱:magento2-continuousphp,代碼行數:23,代碼來源:Configurable.php

示例5: deleteItem

 /**
  * Removes the item from the pool.
  *
  * @param string $key
  *   The key for which to delete
  *
  * @throws InvalidArgumentException
  *   If the $key string is not a legal value a \Psr\Cache\InvalidArgumentException
  *   MUST be thrown.
  *
  * @return bool
  *   True if the item was successfully removed. False if there was an error.
  */
 public function deleteItem($key)
 {
     return $this->cacheFrontend->remove($this->prepareKey($key));
 }
開發者ID:ecomdev,項目名稱:magento-psr6-bridge,代碼行數:17,代碼來源:CacheItemPool.php

示例6: remove

 /**
  * Remove notification from cache
  *
  * @param string $notificationType
  * @param string $customerId
  * @return void
  */
 public function remove($notificationType, $customerId)
 {
     $this->cache->remove($this->getCacheKey($notificationType, $customerId));
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:11,代碼來源:NotificationStorage.php

示例7: save

 /**
  * Save configurable product depended data
  *
  * @param \Magento\Catalog\Model\Product $product
  * @return $this
  * @throws \InvalidArgumentException
  * @deprecated the \Magento\ConfigurableProduct\Model\Product\SaveHandler::execute should be used instead
  */
 public function save($product)
 {
     parent::save($product);
     $metadata = $this->getMetadataPool()->getMetadata(ProductInterface::class);
     $cacheId = __CLASS__ . $product->getData($metadata->getLinkField()) . '_' . $product->getStoreId();
     $this->cache->remove($cacheId);
     $extensionAttributes = $product->getExtensionAttributes();
     // this approach is needed for 3rd-party extensions which are not using extension attributes
     if (empty($extensionAttributes->getConfigurableProductOptions())) {
         $this->saveConfigurableOptions($product);
     }
     if (empty($extensionAttributes->getConfigurableProductLinks())) {
         $this->saveRelatedProducts($product);
     }
     return $this;
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:24,代碼來源:Configurable.php

示例8: persist

 /**
  * Save the current statuses (enabled/disabled) of cache types to the persistent storage
  *
  * @return void
  */
 public function persist()
 {
     $this->_options->saveAllOptions($this->_typeStatuses);
     $this->_cacheFrontend->remove(self::CACHE_ID);
 }
開發者ID:pavelnovitsky,項目名稱:magento2,代碼行數:10,代碼來源:State.php


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