Prado\Data\TDbConnection::getConnectionString PHP Метод

getConnectionString() публичный Метод

public getConnectionString ( ) : string
Результат string The Data Source Name, or DSN, contains the information required to connect to the database.
    public function getConnectionString()
    {
        return $this->_dsn;
    }

Usage Example

Пример #1
0
 /**
  * Returns table information for table in the database connection.
  * @param TDbConnection database connection
  * @param string table name
  * @return TDbTableInfo table details.
  */
 public function getTableInfo(TDbConnection $connection, $tableName)
 {
     $connStr = $connection->getConnectionString();
     $key = $connStr . $tableName;
     if (!isset($this->_tables[$key])) {
         //call this first to ensure that unserializing the cache
         //will find the correct driver dependent classes.
         if (!isset($this->_meta[$connStr])) {
             $this->_meta[$connStr] = TDbMetaData::getInstance($connection);
         }
         $tableInfo = null;
         if (($cache = $this->getManager()->getCache()) !== null) {
             $tableInfo = $cache->get($key);
         }
         if (empty($tableInfo)) {
             $tableInfo = $this->_meta[$connStr]->getTableInfo($tableName);
             if ($cache !== null) {
                 $cache->set($key, $tableInfo);
             }
         }
         $this->_tables[$key] = $tableInfo;
     }
     return $this->_tables[$key];
 }