本文整理汇总了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);
}
示例2: remove
/**
* Remove cached data by identifier
*
* @param string $identifier
* @return bool
*/
public function remove($identifier)
{
return $this->_frontend->remove($identifier);
}
示例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;
}
示例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;
}
示例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));
}
示例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));
}
示例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;
}
示例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);
}