yii\mongodb\i18n\MongoDbMessageSource::init PHP Method

init() public method

This method will initialize the [[db]] property to make sure it refers to a valid DB connection. Configured [[cache]] component would also be initialized.
public init ( )
    public function init()
    {
        parent::init();
        $this->db = Instance::ensure($this->db, Connection::className());
        if ($this->enableCaching) {
            $this->cache = Instance::ensure($this->cache, Cache::className());
        }
    }