vendor/pimcore/pimcore/lib/Cache/Runtime.php line 80

Open in your IDE?
  1. <?php
  2. /**
  3.  * Pimcore
  4.  *
  5.  * This source file is available under two different licenses:
  6.  * - GNU General Public License version 3 (GPLv3)
  7.  * - Pimcore Commercial License (PCL)
  8.  * Full copyright and license information is available in
  9.  * LICENSE.md which is distributed with this source code.
  10.  *
  11.  *  @copyright  Copyright (c) Pimcore GmbH (http://www.pimcore.org)
  12.  *  @license    http://www.pimcore.org/license     GPLv3 and PCL
  13.  */
  14. namespace Pimcore\Cache;
  15. /**
  16.  * @deprecated
  17.  */
  18. final class Runtime extends RuntimeCache
  19. {
  20.     /**
  21.      * Retrieves the default registry instance.
  22.      *
  23.      * @return RuntimeCache
  24.      */
  25.     public static function getInstance(): RuntimeCache
  26.     {
  27.         trigger_deprecation(
  28.             'pimcore/pimcore',
  29.             '10.5.0',
  30.             sprintf('%s is deprecated. Use %s instead!'__METHOD__'RuntimeCache::getInstance')
  31.         );
  32.         return parent::getInstance();
  33.     }
  34.     /**
  35.      * getter method, basically same as offsetGet().
  36.      *
  37.      * This method can be called from an object of type \Pimcore\Cache\Runtime, or it
  38.      * can be called statically.  In the latter case, it uses the default
  39.      * static instance stored in the class.
  40.      *
  41.      * @param string $index - get the value associated with $index
  42.      *
  43.      * @return mixed
  44.      *
  45.      * @deprecated
  46.      *
  47.      * @throws \Exception if no entry is registered for $index.
  48.      */
  49.     public static function get($index)
  50.     {
  51.         trigger_deprecation(
  52.             'pimcore/pimcore',
  53.             '10.5.0',
  54.             sprintf('%s is deprecated. Use %s instead!'__METHOD__'RuntimeCache::get')
  55.         );
  56.         return parent::get($index);
  57.     }
  58.     /**
  59.      * setter method, basically same as offsetSet().
  60.      *
  61.      * This method can be called from an object of type \Pimcore\Cache\Runtime, or it
  62.      * can be called statically.  In the latter case, it uses the default
  63.      * static instance stored in the class.
  64.      *
  65.      * @param string $index The location in the ArrayObject in which to store
  66.      *   the value.
  67.      * @param mixed $value The object to store in the ArrayObject.
  68.      *
  69.      * @deprecated
  70.      *
  71.      * @return void
  72.      */
  73.     public static function set($index$value)
  74.     {
  75.         trigger_deprecation(
  76.             'pimcore/pimcore',
  77.             '10.5.0',
  78.             sprintf('%s is deprecated. Use %s instead!'__METHOD__'RuntimeCache::set')
  79.         );
  80.         parent::set($index$value);
  81.     }
  82.     /**
  83.      * Returns TRUE if the $index is a named value in the registry,
  84.      * or FALSE if $index was not found in the registry.
  85.      *
  86.      * @param  string $index
  87.      *
  88.      * @deprecated
  89.      *
  90.      * @return bool
  91.      */
  92.     public static function isRegistered($index)
  93.     {
  94.         trigger_deprecation(
  95.             'pimcore/pimcore',
  96.             '10.5.0',
  97.             sprintf('%s is deprecated. Use %s instead!'__METHOD__'RuntimeCache::isRegistered')
  98.         );
  99.         return RuntimeCache::isRegistered($index);
  100.     }
  101.     /**
  102.      * Constructs a parent ArrayObject with default
  103.      * ARRAY_AS_PROPS to allow access as an object
  104.      *
  105.      * @param array $array data array
  106.      * @param int $flags ArrayObject flags
  107.      */
  108.     public function __construct($array = [], $flags parent::ARRAY_AS_PROPS)
  109.     {
  110.         trigger_deprecation(
  111.             'pimcore/pimcore',
  112.             '10.5.0',
  113.             sprintf('%s is deprecated. Use %s instead!'__METHOD__'new RuntimeCache($array, $flags)')
  114.         );
  115.         parent::__construct($array$flags);
  116.     }
  117.     /**
  118.      * @param int|string $index
  119.      * @param mixed $value
  120.      *
  121.      * @deprecated
  122.      */
  123.     public function offsetSet($index$value): void
  124.     {
  125.         trigger_deprecation(
  126.             'pimcore/pimcore',
  127.             '10.5.0',
  128.             sprintf('%s is deprecated. Use %s instead!'__METHOD__'RuntimeCache::offsetSet')
  129.         );
  130.         parent::offsetSet($index$value);
  131.     }
  132.     /**
  133.      * Alias of self::set() to be compatible with Pimcore\Cache
  134.      *
  135.      * @deprecated
  136.      *
  137.      * @param mixed $data
  138.      * @param string $id
  139.      */
  140.     public static function save($data$id)
  141.     {
  142.         trigger_deprecation(
  143.             'pimcore/pimcore',
  144.             '10.5.0',
  145.             sprintf('%s is deprecated. Use %s instead!'__METHOD__'RuntimeCache::save')
  146.         );
  147.         parent::save($data$id);
  148.     }
  149.     /**
  150.      * Alias of self::get() to be compatible with Pimcore\Cache
  151.      *
  152.      * @deprecated
  153.      *
  154.      * @param string $id
  155.      *
  156.      * @return mixed
  157.      */
  158.     public static function load($id)
  159.     {
  160.         trigger_deprecation(
  161.             'pimcore/pimcore',
  162.             '10.5.0',
  163.             sprintf('%s is deprecated. Use %s instead!'__METHOD__'RuntimeCache::load')
  164.         );
  165.         return parent::load($id);
  166.     }
  167.     /**
  168.      * @param array $keepItems
  169.      *
  170.      * @deprecated
  171.      */
  172.     public static function clear($keepItems = [])
  173.     {
  174.         trigger_deprecation(
  175.             'pimcore/pimcore',
  176.             '10.5.0',
  177.             sprintf('%s is deprecated. Use %s instead!'__METHOD__'RuntimeCache::clear')
  178.         );
  179.         parent::clear($keepItems);
  180.     }
  181. }