Exemple #1
0
 private function invalidate($part)
 {
     if ($this->enableCaching) {
         GroupDependency::invalidate($this->cache, $this->buildGroup($part));
     }
 }
 /**
  * Refreshes the schema.
  * This method cleans up all cached table schemas so that they can be re-created later
  * to reflect the database schema change.
  */
 public function refresh()
 {
     /** @var Cache $cache */
     $cache = is_string($this->db->schemaCache) ? Yii::$app->getComponent($this->db->schemaCache) : $this->db->schemaCache;
     if ($this->db->enableSchemaCache && $cache instanceof Cache) {
         GroupDependency::invalidate($cache, $this->getCacheGroup());
     }
     $this->_tableNames = [];
     $this->_tables = [];
 }