Vsch\TranslationManager\Manager::setConnectionName PHP Méthode

setConnectionName() public méthode

public setConnectionName ( $connection = null )
    public function setConnectionName($connection = null)
    {
        if ($connection === null || $connection === '') {
            // resetting to default
            $connection = $this->default_translation_connection;
        }
        $this->translation->setConnection($connection);
        $this->indatabase_publish = $this->getConnectionInDatabasePublish($connection);
        $this->clearCache();
    }

Usage Example

 public function setConnectionName($connection)
 {
     if (!array_key_exists($connection, $this->connectionList)) {
         $connection = '';
     }
     \Cookie::queue($this->cookieName(self::COOKIE_CONNECTION_NAME), $connection, 60 * 24 * 365 * 1);
     $this->manager->setConnectionName($connection);
 }