original_string: private function clearSiteCaches()
      {
          $obj = Craft::$app->sites;
          $refObject = new \ReflectionObject($obj);
          if ($refObject->hasProperty('_sitesById')) {
              $refProperty1 = $refObject->getProperty('_sitesById');
              $refProperty1->setAccessible(true);
              $refProperty1->setValue($obj, null);
          }
          if ($refObject->hasProperty('_sitesByHandle')) {
              $refProperty2 = $refObject->getProperty('_sitesByHandle');
              $refProperty2->setAccessible(true);
              $refProperty2->setValue($obj, null);
          }
          $obj->init(); // reload sites
      }
code: private function clearSiteCaches()
      {
          $obj = Craft::$app->sites;
          $refObject = new \ReflectionObject($obj);
          if ($refObject->hasProperty('_sitesById')) {
              $refProperty1 = $refObject->getProperty('_sitesById');
              $refProperty1->setAccessible(true);
              $refProperty1->setValue($obj, null);
          }
          if ($refObject->hasProperty('_sitesByHandle')) {
              $refProperty2 = $refObject->getProperty('_sitesByHandle');
              $refProperty2->setAccessible(true);
              $refProperty2->setValue($obj, null);
          }
          $obj->init(); // reload sites
      }
code_tokens: private function clearSiteCaches ( ) { $ obj = Craft :: $ app -> sites ; $ refObject = new \ ReflectionObject ( $ obj ) ; if ( $ refObject -> hasProperty ( '_sitesById' ) ) { $ refProperty1 = $ refObject -> getProperty ( '_sitesById' ) ; $ refProperty1 -> setAccessible ( true ) ; $ refProperty1 -> setValue ( $ obj , null ) ; } if ( $ refObject -> hasProperty ( '_sitesByHandle' ) ) { $ refProperty2 = $ refObject -> getProperty ( '_sitesByHandle' ) ; $ refProperty2 -> setAccessible ( true ) ; $ refProperty2 -> setValue ( $ obj , null ) ; } $ obj -> init ( ) ; // reload sites }
docstring: Reset craft site service sites cache using reflection.
docstring_tokens: Reset craft site service sites cache using reflection .