Overview

Namespaces

  • None
  • RedBeanPHP
    • Adapter
    • BeanHelper
    • Cursor
    • Driver
    • Logger
      • RDefault
    • QueryWriter
    • RedException
    • Repository
    • Util

Classes

  • AQueryWriter
  • CUBRID
  • MySQL
  • PostgreSQL
  • SQLiteT
  • Overview
  • Namespace
  • Class

Class SQLiteT

RedBeanPHP SQLiteWriter with support for SQLite types This is a QueryWriter class for RedBeanPHP. This QueryWriter provides support for the SQLite database platform.

RedBeanPHP\QueryWriter\AQueryWriter
Extended by RedBeanPHP\QueryWriter\SQLiteT implements RedBeanPHP\QueryWriter
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

RedBeanPHP\QueryWriter\AQueryWriter::getKeyMapForType()

Overrides

RedBeanPHP\QueryWriter\AQueryWriter::getKeyMapForType()
public
# __construct( RedBeanPHP\Adapter $adapter )

Constructor

Constructor

Parameters

$adapter
Database Adapter
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

RedBeanPHP\QueryWriter::scanType()
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

RedBeanPHP\QueryWriter\AQueryWriter::addColumn()

Implementation of

RedBeanPHP\QueryWriter::addColumn()
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

RedBeanPHP\QueryWriter::code()
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

RedBeanPHP\QueryWriter\AQueryWriter::widenColumn()

Implementation of

RedBeanPHP\QueryWriter::widenColumn()
public array
# getTables( )

Returns

array

See

QueryWriter::getTables();

Implementation of

RedBeanPHP\QueryWriter::getTables()
public
# createTable( string $table )

Parameters

$table
$type type of bean you want to create a table for

See

QueryWriter::createTable

Implementation of

RedBeanPHP\QueryWriter::createTable()
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

RedBeanPHP\QueryWriter::getColumns()
public
# addUniqueConstraint( string $type, array $properties )

Parameters

$type
target bean type
$properties
$columnsPartOfIndex columns to include in index

See

QueryWriter::addUniqueIndex

Implementation of

RedBeanPHP\QueryWriter::addUniqueConstraint()
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

RedBeanPHP\QueryWriter::sqlStateIn()
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

RedBeanPHP\QueryWriter::addIndex()
public
# wipe( string $type )

Parameters

$type
bean type

See

QueryWriter::wipe

Overrides

RedBeanPHP\QueryWriter\AQueryWriter::wipe()

Implementation of

RedBeanPHP\QueryWriter::wipe()
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

RedBeanPHP\QueryWriter::addFK()
public
# wipeAll( )

See

QueryWriter::wipeAll

Implementation of

RedBeanPHP\QueryWriter::wipeAll()
Methods inherited from RedBeanPHP\QueryWriter\AQueryWriter
addDataType(), addUniqueIndex(), camelsSnake(), canBeTreatedAsInt(), check(), clearRenames(), deleteRecord(), deleteRelations(), esc(), flushCache(), getAssocTable(), getAssocTableFormat(), getForeignKeyForTypeProperty(), getInsertSuffix(), getParametersForInClause(), getSQLFilterSnippet(), getSQLFilters(), glueLimitOne(), glueSQLCondition(), inferFetchType(), insertRecord(), makeFKLabel(), queryRecord(), queryRecordCount(), queryRecordCountRelated(), queryRecordLink(), queryRecordRelated(), queryRecordWithCursor(), queryTagged(), renameAssocTable(), renameAssociation(), safeColumn(), safeTable(), setNarrowFieldMode(), setSQLFilters(), setUseCache(), startsWithZeros(), tableExists(), updateRecord(), writeJoin()
Constants summary
integer C_DATATYPE_INTEGER

Data types

Data types

# 0
integer C_DATATYPE_NUMERIC
# 1
integer C_DATATYPE_TEXT
# 2
integer C_DATATYPE_SPECIFIED
# 99
Constants inherited from RedBeanPHP\QueryWriter
C_DATATYPE_RANGE_SPECIAL, C_DATATYPE_RANGE_SPECIFIED, C_GLUE_AND, C_GLUE_WHERE, C_SQLFILTER_READ, C_SQLFILTER_WRITE, C_SQLSTATE_INTEGRITY_CONSTRAINT_VIOLATION, C_SQLSTATE_NO_SUCH_COLUMN, C_SQLSTATE_NO_SUCH_TABLE
Properties summary
protected RedBeanPHP\Adapter\DBAdapter $adapter
#
protected string $quoteCharacter
# '`'
Properties inherited from RedBeanPHP\QueryWriter\AQueryWriter
$cache, $defaultValue, $flagUseCache, $maxCacheSizePerType, $renames, $typeno_sqltype
API documentation generated by ApiGen