Lançado Adianti Framework 7.6!
Clique aqui para saber mais
menu

Adianti Solutions

API

Adianti, Framework, PHP, MVC, Active record, Front controller, IDE, RAD, Web, multiplataforma, geração de código, desenvolvimento rápido, relatórios, formulários, listagens, datagrids, gráficos, banco de dados, padrões de projeto, design patterns API do Adianti Framework.
API Docs
code
Selecione a classe

Class TDatabase

Description

Database Task manager

Located in /database/TDatabase.php (line 26)


	
			
Method Summary
static addColumn ($conn, $table, $column, $type, $options)
static clearData ($conn, $table, [$criteria = null])
static copyData ($source_conn, $target_conn, $source_table, $target_table, $mapping, [$criteria = null], [$bulk_inserts = 1], [$auto_commit = false])
static copyQuery ($source_conn, $target_conn, $query, $target_table, $mapping, [$prepared_values = null], [$bulk_inserts = 1], [$auto_commit = false])
static countData ($conn, $table, [$criteria = null])
static createTable ($conn, $table, $columns)
static dropColumn ($conn, $table, $column)
static dropTable ($conn, $table, [$ifexists = false])
static execute ($conn, $query)
static exportToFile ($source_conn, $source_table, $filename, $mapping, [$criteria = null], [$separator = ','])
static getData ($conn, $query, [$mapping = null], [$prepared_values = null], [$action = null])
static importFromFile ($filename, $target_conn, $target_table, $mapping, [$separator = ','], [$bulk_inserts = 1])
static insertData ($conn, $table, $values, [$avoid_criteria = null])
static updateData ($conn, $table, $values, [$criteria = null])
Methods
static addColumn (line 118)

Add column

  • access: public
static addColumn ($conn, $table, $column, $type, $options)
  • $conn: Connection
  • $table: Table name
  • $column: Column name
  • $type: Column type
  • $options: Column options
static clearData (line 216)

Clear table data

  • access: public
static clearData ($conn, $table, [$criteria = null])
  • $conn: Connection
  • $table: Table name
  • $criteria: Filter criteria
static copyData (line 341)

Copy data from table to table

  • access: public
static copyData ($source_conn, $target_conn, $source_table, $target_table, $mapping, [$criteria = null], [$bulk_inserts = 1], [$auto_commit = false])
  • $source_conn: PDO source connection
  • $target_conn: PDO target connection
  • $source_table: Source table
  • $target_table: Target table
  • $mapping: Mapping between fields
  • $criteria: Filter criteria
  • $bulk_inserts: Inserts per time
  • $auto_commit: Auto commit after x inserts
static copyQuery (line 432)

Copy data from query to table

  • access: public
static copyQuery ($source_conn, $target_conn, $query, $target_table, $mapping, [$prepared_values = null], [$bulk_inserts = 1], [$auto_commit = false])
  • $source_conn: PDO source connection
  • $target_conn: PDO target connection
  • $query: SQL Query
  • $target_table: Target table
  • $mapping: Mapping between fields
  • $prepared_values: Parameters for SQL Query
  • $bulk_inserts: Inserts per time
  • $auto_commit: Auto commit after x inserts
static countData (line 295)

Count data from table

  • access: public
static countData ($conn, $table, [$criteria = null])
  • $conn: PDO source connection
  • $table: Source table
  • $criteria: Filter criteria
static createTable (line 81)

Create table

  • access: public
static createTable ($conn, $table, $columns)
  • $conn: Connection
  • $table: Table name
  • $columns: Array of columns
static dropColumn (line 102)

Drop column

  • access: public
static dropColumn ($conn, $table, $column)
  • $conn: Connection
  • $table: Table name
  • $column: Column name
static dropTable (line 35)

Drop table

  • access: public
static dropTable ($conn, $table, [$ifexists = false])
  • $conn: Connection
  • $table: Table name
  • $ifexists: Drop only if exists
static execute (line 235)

Execute SQL

  • access: public
static execute ($conn, $query)
  • $conn: Connection
  • $query: SQL
static exportToFile (line 572)

Export data to CSV file

  • access: public
static exportToFile ($source_conn, $source_table, $filename, $mapping, [$criteria = null], [$separator = ','])
  • $source_conn: Source connection
  • $source_table: Target table
  • $filename: CSV File to import
  • $mapping: Mapping between fields
  • $criteria: Select criteria
  • $separator: Columns separator [,]
static getData (line 249)

Get RAW Data

  • access: public
static getData ($conn, $query, [$mapping = null], [$prepared_values = null], [$action = null])
  • $conn: Connection
  • $query: SQL
  • $mapping: Mapping between fields
  • $prepared_values: Parameters for SQL Query
  • $action
static importFromFile (line 503)

Import data from CSV file

  • access: public
static importFromFile ($filename, $target_conn, $target_table, $mapping, [$separator = ','], [$bulk_inserts = 1])
  • $filename: CSV File to import
  • $target_conn: Target connection
  • $target_table: Target table
  • $mapping: Mapping between fields
  • $separator: Columns separator [,]
  • $bulk_inserts
static insertData (line 133)

Insert data

  • access: public
static insertData ($conn, $table, $values, [$avoid_criteria = null])
  • $conn: Connection
  • $table: Table name
  • $values: Array of values
  • $avoid_criteria: Criteria to avoid insertion
static updateData (line 177)

Update data

  • access: public
static updateData ($conn, $table, $values, [$criteria = null])
  • $conn: Connection
  • $table: Table name
  • $values: Array of values
  • $criteria: Criteria to avoid insertion