original_string: public function invalidateArchivedReports($idSites, $dates, $period = false, $segment = false, $cascadeDown = false)
      {
          $idSites = Site::getIdSitesFromIdSitesString($idSites);
          if (empty($idSites)) {
              throw new Exception("Specify a value for &idSites= as a comma separated list of website IDs, for which your token_auth has 'admin' permission");
          }
  
          Piwik::checkUserHasAdminAccess($idSites);
  
          if (!empty($segment)) {
              $segment = new Segment($segment, $idSites);
          } else {
              $segment = null;
          }
  
          list($dateObjects, $invalidDates) = $this->getDatesToInvalidateFromString($dates);
  
          $invalidationResult = $this->invalidator->markArchivesAsInvalidated($idSites, $dateObjects, $period, $segment, (bool)$cascadeDown);
  
          $output = $invalidationResult->makeOutputLogs();
          if ($invalidDates) {
              $output[] = 'Warning: some of the Dates to invalidate were invalid: ' .
                  implode(", ", $invalidDates) . ". Matomo simply ignored those and proceeded with the others.";
          }
  
          Site::clearCache(); // TODO: is this needed? it shouldn't be needed...
  
          return $invalidationResult->makeOutputLogs();
      }
code: public function invalidateArchivedReports($idSites, $dates, $period = false, $segment = false, $cascadeDown = false)
      {
          $idSites = Site::getIdSitesFromIdSitesString($idSites);
          if (empty($idSites)) {
              throw new Exception("Specify a value for &idSites= as a comma separated list of website IDs, for which your token_auth has 'admin' permission");
          }
  
          Piwik::checkUserHasAdminAccess($idSites);
  
          if (!empty($segment)) {
              $segment = new Segment($segment, $idSites);
          } else {
              $segment = null;
          }
  
          list($dateObjects, $invalidDates) = $this->getDatesToInvalidateFromString($dates);
  
          $invalidationResult = $this->invalidator->markArchivesAsInvalidated($idSites, $dateObjects, $period, $segment, (bool)$cascadeDown);
  
          $output = $invalidationResult->makeOutputLogs();
          if ($invalidDates) {
              $output[] = 'Warning: some of the Dates to invalidate were invalid: ' .
                  implode(", ", $invalidDates) . ". Matomo simply ignored those and proceeded with the others.";
          }
  
          Site::clearCache(); // TODO: is this needed? it shouldn't be needed...
  
          return $invalidationResult->makeOutputLogs();
      }
code_tokens: public function invalidateArchivedReports ( $ idSites , $ dates , $ period = false , $ segment = false , $ cascadeDown = false ) { $ idSites = Site :: getIdSitesFromIdSitesString ( $ idSites ) ; if ( empty ( $ idSites ) ) { throw new Exception ( "Specify a value for &idSites= as a comma separated list of website IDs, for which your token_auth has 'admin' permission" ) ; } Piwik :: checkUserHasAdminAccess ( $ idSites ) ; if ( ! empty ( $ segment ) ) { $ segment = new Segment ( $ segment , $ idSites ) ; } else { $ segment = null ; } list ( $ dateObjects , $ invalidDates ) = $ this -> getDatesToInvalidateFromString ( $ dates ) ; $ invalidationResult = $ this -> invalidator -> markArchivesAsInvalidated ( $ idSites , $ dateObjects , $ period , $ segment , ( bool ) $ cascadeDown ) ; $ output = $ invalidationResult -> makeOutputLogs ( ) ; if ( $ invalidDates ) { $ output [ ] = 'Warning: some of the Dates to invalidate were invalid: ' . implode ( ", " , $ invalidDates ) . ". Matomo simply ignored those and proceeded with the others." ; } Site :: clearCache ( ) ; // TODO: is this needed? it shouldn't be needed... return $ invalidationResult -> makeOutputLogs ( ) ; }
docstring: Invalidates report data, forcing it to be recomputed during the next archiving run.
  
  Note: This is done automatically when tracking or importing visits in the past.
  
  @param string $idSites Comma separated list of site IDs to invalidate reports for.
  @param string $dates Comma separated list of dates of periods to invalidate reports for.
  @param string|bool $period The type of period to invalidate: either 'day', 'week', 'month', 'year', 'range'.
  The command will automatically cascade up, invalidating reports for parent periods as
  well. So invalidating a day will invalidate the week it's in, the month it's in and the
  year it's in, since those periods will need to be recomputed too.
  @param string|bool $segment Optional. The segment to invalidate reports for.
  @param bool $cascadeDown If true, child periods will be invalidated as well. So if it is requested to invalidate
  a month, then all the weeks and days within that month will also be invalidated. But only
  if this parameter is set.
  @throws Exception
  @return array
  @hideExceptForSuperUser
docstring_tokens: Invalidates report data forcing it to be recomputed during the next archiving run .