Namespace: RedBeanPHP\
QueryWriter
Copyright:
(c) copyright G.J.G.T. (Gabor) de Mooij and the RedBeanPHP Community.
This source file is subject to the BSD/GPLv2 License that is bundled
with this source code in the file license.txt.
License:
BSD/GPLv2
Author:
Gabor de Mooij and the RedBeanPHP Community
File:
RedBeanPHP/QueryWriter/SQLiteT.php
Located at QueryWriter/SQLiteT.php
Methods summary
protected
array
|
#
getTable( string $type )
Gets all information about a table (from a type).
Gets all information about a table (from a type).
Format:
array( name => name of the table columns => array( name => datatype ) indexes => array() raw index information rows from PRAGMA query keys => array() raw key information rows from PRAGMA query
)
Parameters
- $type
- type you want to get info of
Returns
array
|
protected
|
#
putTable( array $tableMap )
Puts a table. Updates the table structure.
In SQLite we can't change columns, drop columns, change or add foreign keys so we
have a table-rebuild function. You simply load your table with getTable(), modify it and
then store it with putTable()...
Puts a table. Updates the table structure.
In SQLite we can't change columns, drop columns, change or add foreign keys so we
have a table-rebuild function. You simply load your table with getTable(), modify it and
then store it with putTable()...
Parameters
- $tableMap
- information array
|
protected
array
|
#
getIndexes( string $type )
Returns the an array describing the indexes for type $type.
Returns the an array describing the indexes for type $type.
Parameters
- $type
- type to describe indexes of
Returns
array
|
protected
boolean
|
#
buildFK( string $type, string $targetType, string $property, string $targetProperty, integer $constraint = FALSE )
Adds a foreign key to a type.
Note: cant put this in try-catch because that can hide the fact
that database has been damaged.
Adds a foreign key to a type.
Note: cant put this in try-catch because that can hide the fact
that database has been damaged.
Parameters
- $type
- type you want to modify table of
- $targetType
- target type
- $property
- $field field of the type that needs to get the fk
- $targetProperty
- $targetField field where the fk needs to point to
- $constraint
- $buildopt 0 = NO ACTION, 1 = ON DELETE CASCADE
Returns
boolean
|
protected
array
|
#
getKeyMapForType( string $type )
Parameters
- $type
- the bean type you wish to obtain a key map of
Returns
array
See
Overrides
|
public
|
|
public
integer
|
#
getTypeForID( )
This method returns the datatype to be used for primary key IDS and
foreign keys. Returns one if the data type constants.
This method returns the datatype to be used for primary key IDS and
foreign keys. Returns one if the data type constants.
Returns
integer $const data type to be used for IDS.
|
public
integer
|
#
scanType( string $value, $flagSpecial = FALSE )
Parameters
- $value
- value
- $flagSpecial
Returns
integer
See
QueryWriter::scanType
Implementation of
|
public
|
#
addColumn( string $table, string $column, integer $type )
Parameters
- $table
- $type name of the table
- $column
- name of the column
- $type
- $field data type for field
See
QueryWriter::addColumn
Overrides
Implementation of
|
public
integer
|
#
code( string $typedescription, boolean $includeSpecials = FALSE )
Parameters
- $typedescription
- description
- $includeSpecials
- whether you want to get codes for special columns as well
Returns
integer
See
QueryWriter::code
Implementation of
|
public
|
#
widenColumn( string $type, string $column, integer $datatype )
Parameters
- $type
- type / table that needs to be adjusted
- $column
- column that needs to be altered
- $datatype
- target data type
See
QueryWriter::widenColumn
Overrides
Implementation of
|
public
array
|
#
getTables( )
Returns
array
See
QueryWriter::getTables();
Implementation of
|
public
|
#
createTable( string $table )
Parameters
- $table
- $type type of bean you want to create a table for
See
QueryWriter::createTable
Implementation of
|
public
array
|
#
getColumns( string $table )
Parameters
- $table
- $type type of bean you want to obtain a column list of
Returns
array
See
QueryWriter::getColumns
Implementation of
|
public
|
#
addUniqueConstraint( string $type, array $properties )
Parameters
- $type
- target bean type
- $properties
- $columnsPartOfIndex columns to include in index
See
QueryWriter::addUniqueIndex
Implementation of
|
public
boolean
|
#
sqlStateIn( string $state, array $list )
Parameters
- $state
- SQL state to consider
- $list
- list of standardized SQL state constants to check against
Returns
boolean
See
QueryWriter::sqlStateIn
Implementation of
|
public
|
#
addIndex( string $type, string $name, string $column )
Parameters
- $type
- type to add index to
- $name
- name of the new index
- $column
- $property field to index
See
QueryWriter::addIndex
Implementation of
|
public
|
#
wipe( string $type )
Parameters
See
QueryWriter::wipe
Overrides
Implementation of
|
public
|
#
addFK( string $type, string $targetType, string $property, string $targetProperty, string $isDep = FALSE )
Parameters
- $type
- type that will have a foreign key field
- $targetType
- points to this type
- $property
- field that contains the foreign key value
- $targetProperty
- field where the fk points to
- $isDep
- whether target is dependent and should cascade on update/delete
See
QueryWriter::addFK
Implementation of
|
public
|
#
wipeAll( )
See
QueryWriter::wipeAll
Implementation of
|