Dibi\Connection::getDatabaseInfo PHP Method

getDatabaseInfo() public method

Gets a information about the current database.
public getDatabaseInfo ( ) : Dibi\Reflection\Database
return Dibi\Reflection\Database
    public function getDatabaseInfo()
    {
        $this->connected || $this->connect();
        return new Reflection\Database($this->driver->getReflector(), isset($this->config['database']) ? $this->config['database'] : NULL);
    }

Usage Example

示例#1
0
 /**
  * @return mixed
  */
 private function getPrimaryKey()
 {
     $primaryKey = $this->db->getDatabaseInfo()->getTable($this->tableName)->getPrimaryKey()->getColumns();
     return $primaryKey[0]->name;
 }