Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
48 | private function resetCraftSiteServiceSiteIdsCache() |
||
49 | { |
||
50 | $obj = Craft::$app->sites; |
||
51 | $refObject = new \ReflectionObject($obj); |
||
52 | if ($refObject->hasProperty('_sitesById')) { |
||
53 | $refProperty1 = $refObject->getProperty('_sitesById'); |
||
54 | $refProperty1->setAccessible(true); |
||
55 | $refProperty1->setValue($obj, null); |
||
56 | $obj->init(); // reload sites |
||
57 | } |
||
58 | } |
||
59 | } |
||
60 |