code: public function getForeignModels()
      {
          if (is_null($this->_models)) {
              $this->_models = [];
              foreach ($this->db->schema->getTableNames() as $tableName) {
                  $modelName = $this->getForeignModelName($tableName);
                  $this->_models[$modelName] = Yii::createObject($this->getForeignModelConfig($tableName, $modelName));
              }
          }
  
          return $this->_models;
      }
docs: Get foreign models.
  
  @return array the collected foreign models