type; } /** * {@inheritdoc} */ public function getStatus() : int { return $this->status; } /** * Get database name. * * @return string * * @since 1.0.0 */ public function getDatabase() : string { return $this->dbdata['database'] ?? ''; } /** * Get database host. * * @return string * * @since 1.0.0 */ public function getHost() : string { return $this->dbdata['host'] ?? ''; } /** * Get database port. * * @return int * * @since 1.0.0 */ public function getPort() : int { return (int) $this->dbdata['port'] ?? 0; } /** * Get table prefix. * * @return string * * @since 1.0.0 */ public function getPrefix() : string { return $this->prefix; } /** * {@inheritdoc} */ public function getGrammar() : Grammar { if (!isset($this->grammar)) { $this->grammar = new Grammar(); } return $this->grammar; } /** * {@inheritdoc} */ public function getSchemaGrammar() : SchemaGrammar { if (!isset($this->schemaGrammar)) { $this->schemaGrammar = new SchemaGrammar(); } return $this->schemaGrammar; } /** * Object destructor. * * Sets the database connection to null * * @since 1.0.0 */ public function __destruct() { $this->close(); } /** * {@inheritdoc} */ public function close() /* : void */ { $this->con = null; $this->status = DatabaseStatus::CLOSED; } }