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;
    }