Invalidate templates if any of the sources have been updated.

@param SourceSetEvent $sourceSetEvent Source Set Event
346998
public function beforeRun(SourceSetEvent $sourceSetEvent): void
    {
        $updated = $sourceSetEvent->updatedSources();
        if ($updated) {
            $this->twig->invalidateLoadedTemplates();
        }
    }
85068
public void setTemplateSource(String name, String source) {
        mTemplateSources.put(name, new TemplateSource(name, source));
    }
1149237
public function handlePreRemove(RemoveEvent $event)
    {
        $document = $event->getDocument();

        if (!$this->supports($document)) {
            return;
        }

        $event = $this->getDeleteEvent($document);
        $this->deleteEvents[spl_object_hash($document)] = $event;
        $this->eventDispatcher->dispatch(
            ContentEvents::NODE_PRE_DELETE,
            $event
        );
    }
551003
public function onValueChanged(ValueChangedEvent $event)
    {
        // @todo Possible optimization: only track events for EmbedRoot entities,
        // what will save some memory when dealing with deeply nested embed structures.
        $this->changes->push($event);
        $this->propagateEntityChangedEvent($event);
    }
849617
public function onResourcesDelete(GenericDatasEvent $event)
    {
        $resources = $event->getDatas();
        $ids = array();

        foreach ($resources as $resource) {
            $ids[] = $resource->getId();
        }
        $this->tagManager->removeTaggedObjectsByClassAndIds(
            'Claroline\CoreBundle\Entity\Resource\ResourceNode',
            $ids
        );
    }
1004724
public function setSource($source)
    {
        if ($source !== null && !\Erebot\Utils::stringifiable($source)) {
            throw new \Erebot\InvalidValueException('Not a valid nickname');
        }

        $this->source = $source;
    }
1040044
protected function propagateCollectionChangedEvent(CollectionChangedEvent $event)
    {
        if ($event->getType() === CollectionChangedEvent::ITEM_REMOVED) {
            $event->getItem()->removeEntityChangedListener($this);
        } else {
            $event->getItem()->addEntityChangedListener($this);
        }

        parent::propagateCollectionChangedEvent($event);
    }
1183300
private function setSource(string $newSource): void
    {
        $rawTokens = token_get_all($newSource);
        foreach ($rawTokens as $index => $rawToken) {
            $this->tokenStream[$index] = is_array($rawToken) ? $rawToken : [T_STRING, $rawToken];
        }
    }
1095476
public static function invalidate_by_event($event, array $keys) {
        $instance = cache_config::instance();
        $invalidationeventset = false;
        $factory = cache_factory::instance();
        $inuse = $factory->get_caches_in_use();
        $purgetoken = null;
        foreach ($instance->get_definitions() as $name => $definitionarr) {
            $definition = cache_definition::load($name, $definitionarr);
            if ($definition->invalidates_on_event($event)) {
                // First up check if there is a cache loader for this definition already.
                // If there is we need to invalidate the keys from there.
                $definitionkey = $definition->get_component().'/'.$definition->get_area();
                if (isset($inuse[$definitionkey])) {
                    $inuse[$definitionkey]->delete_many($keys);
                }

                // We should only log events for application and session caches.
                // Request caches shouldn't have events as all data is lost at the end of the request.
                // Events should only be logged once of course and likely several definitions are watching so we
                // track its logging with $invalidationeventset.
                $logevent = ($invalidationeventset === false && $definition->get_mode() !== cache_store::MODE_REQUEST);

                if ($logevent) {
                    // Get the event invalidation cache.
                    $cache = cache::make('core', 'eventinvalidation');
                    // Get any existing invalidated keys for this cache.
                    $data = $cache->get($event);
                    if ($data === false) {
                        // There are none.
                        $data = array();
                    }
                    // Add our keys to them with the current cache timestamp.
                    if (null === $purgetoken) {
                        $purgetoken = cache::get_purge_token(true);
                    }
                    foreach ($keys as $key) {
                        $data[$key] = $purgetoken;
                    }
                    // Set that data back to the cache.
                    $cache->set($event, $data);
                    // This only needs to occur once.
                    $invalidationeventset = true;
                }
            }
        }
    }
1330479
@Subscribe
    public void handleRuleChanges(RulesChangedEvent event) {
        event.deletedRuleIds().forEach(id -> {
            log.debug("Invalidated rule {}", id);
            metricRegistry.removeMatching((name, metric) -> name.startsWith(name(Rule.class, id)));
        });
        event.updatedRuleIds().forEach(id -> log.debug("Refreshing rule {}", id));
        scheduler.schedule(() -> serverEventBus.post(reloadAndSave()), 0, TimeUnit.SECONDS);
    }
766294
public function onBeforeNormalization(BeforeNormalizationEvent $event): void
    {
        $resource = $event->getResource();

        if (!$resource instanceof RelatedResourceInterface) {
            return;
        }

        $relations = $resource->getRelations();

        foreach ($relations as $relation) {
            if (!$relation instanceof SymfonyGrantedRelation) {
                continue;
            }

            if (!$this->authorizationChecker->isGranted($relation->getAttribute(), $relation->getObject())) {
                $resource->removeRelation($relation);
            }
        }
    }
501765
public function set_source($source) {
        $filerecord = new stdClass;
        $filerecord->source = $source;
        $this->update($filerecord);
    }
527003
public function invalidateTags($event = null)
    {
        /** @var TagDependencyTrait $this */
        $oldFields = $event !== null && $event->name === ActiveRecord::EVENT_AFTER_UPDATE ? $event->changedAttributes : [];
        \yii\caching\TagDependency::invalidate(
            $this->getTagDependencyCacheComponent(),
            [
                static::commonTag(),
                $this->objectTag($oldFields)
            ]
        );

        if ($this->cacheCompositeTagFields()) {
            \yii\caching\TagDependency::invalidate(
                $this->getTagDependencyCacheComponent(),
                $this->objectCompositeTag($oldFields)
            );
        }

        return true;
    }
48958
public function invalidate() {

		if ( ! \wp_using_ext_object_cache() ) {
			// Clean up old transients.
			foreach ( $this->get_keys_from_database() as $old_transient ) {
				$this->delete( $old_transient, true );
			}
		}

		// Update incrementor.
		$this->incrementor = time();
		$this->set( $this->incrementor_key, $this->incrementor, 0, true );
	}
1248541
public function setSource(Processable $source)
    {
        if ($source instanceof RuleProcessor) {
            parent::setSource($source);
        } else {
            $msg = "RuleProcessingException::setSource only accept RuleProcessor objects.";
            throw new InvalidArgumentException($msg);
        }
    }
908848
public function setCurrentVersionHeader(FilterResponseEvent $event)
    {
        if ($this->version) {
            $event->getResponse()->headers->set(self::HEADER_NAME, $this->version);
        }
    }
132089
protected function triggerEvent($event, $source = null, $data = null) {
		$this->getEventsManager()->trigger($event, $source, $data);
	}