From 6676794f80d9b2f8784a2b76078c64c65a1e46a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Tou=C5=A1ek?= Date: Tue, 19 Apr 2016 12:05:55 +0200 Subject: [PATCH] Fix compatibility with Nette 2.4 --- src/Kdyby/DoctrineCache/DI/Helpers.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Kdyby/DoctrineCache/DI/Helpers.php b/src/Kdyby/DoctrineCache/DI/Helpers.php index 10333a1..de312a7 100644 --- a/src/Kdyby/DoctrineCache/DI/Helpers.php +++ b/src/Kdyby/DoctrineCache/DI/Helpers.php @@ -50,12 +50,12 @@ public static function processCache(Nette\DI\CompilerExtension $extension, $cach { $builder = $extension->getContainerBuilder(); - $impl = $cache instanceof \stdClass ? $cache->value : ($cache instanceof Statement ? $cache->entity : (string) $cache); + $impl = $cache instanceof \stdClass ? $cache->value : ($cache instanceof Statement ? $cache->getEntity() : (string) $cache); list($cache) = self::filterArgs($cache); /** @var Statement $cache */ if (isset(self::$cacheDriverClasses[$impl])) { - $cache->entity = self::$cacheDriverClasses[$impl]; + $cache->setEntity(self::$cacheDriverClasses[$impl]); } if ($impl === 'default') { @@ -69,14 +69,14 @@ public static function processCache(Nette\DI\CompilerExtension $extension, $cach $def = $builder->addDefinition($serviceName = $extension->prefix('cache.' . $suffix)) ->setClass('Doctrine\Common\Cache\Cache') - ->setFactory($cache->entity, $cache->arguments) + ->setFactory($cache->getEntity(), $cache->arguments) ->setAutowired(FALSE); if (method_exists($def, 'setInject')) { @$def->setInject(FALSE); // wow, such deprecated, many BC! } - if (class_exists($cache->entity) && is_subclass_of($cache->entity, 'Doctrine\Common\Cache\CacheProvider')) { + if (class_exists($cache->getEntity()) && is_subclass_of($cache->getEntity(), 'Doctrine\Common\Cache\CacheProvider')) { $ns = 'Kdyby_' . $serviceName; if (preg_match('~^(?P.+)(?:\\\\|\\/)vendor(?:\\\\|\\/)kdyby(?:\\\\|\\/)doctrine-cache(?:\\\\|\\/).+\\z~i', __DIR__, $m)) { @@ -116,7 +116,7 @@ private static function doFilterArguments(array $args) $args[$k] = self::doFilterArguments($v); } elseif ($v instanceof Statement) { - $tmp = self::doFilterArguments(array($v->entity)); + $tmp = self::doFilterArguments(array($v->getEntity())); $args[$k] = new Statement($tmp[0], self::doFilterArguments($v->arguments)); } elseif ($v instanceof \stdClass && isset($v->value, $v->attributes)) {