REDAXO 5
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • redaxo
    • backup
    • be-style
    • core
      • backend
      • form
      • login
      • minibar
      • packages
      • sql
    • cronjob
      • article-status
      • optimize-tables
    • media-manager
    • mediapool
    • metainfo
    • phpmailer
    • structure
      • content
        • minibar
      • history
      • version
    • users

Classes

  • rex_sql
  • rex_sql_column
  • rex_sql_foreign_key
  • rex_sql_index
  • rex_sql_schema_dumper
  • rex_sql_table
  • rex_sql_util

Class rex_sql_table

Class to represent sql tables.

rex_sql_table uses rex_instance_pool_trait
Package: redaxo\core\sql
Author: gharlan
Located at redaxo/src/core/lib/sql/table.php

Methods summary

public static self
# get( string $name )

Parameters

$name

Returns

self
self
public boolean
# exists( )

Returns

boolean
bool
public string
# getName( )

Returns

string
string
public mixed
# setName( string $name )

Parameters

$name

Returns

mixed
$this
public boolean
# hasColumn( string $name )

Parameters

$name

Returns

boolean
bool
public null|rex_sql_column
# getColumn( string $name )

Parameters

$name

Returns

null|rex_sql_column
null|rex_sql_column
public rex_sql_column[]
# getColumns( )

Returns

rex_sql_column[]
rex_sql_column[]
public mixed
# addColumn( rex_sql_column $column, null|string $afterColumn = null )

Parameters

$column
$afterColumn
Column name or <code>rex_sql_table::FIRST</code>

Returns

mixed
$this
public mixed
# ensureColumn( rex_sql_column $column, null|string $afterColumn = null )

Parameters

$column
$afterColumn
Column name or <code>rex_sql_table::FIRST</code>

Returns

mixed
$this
public mixed
# ensurePrimaryIdColumn( )

Returns

mixed
$this
public mixed
# ensureGlobalColumns( )

Returns

mixed
$this
public mixed
# renameColumn( string $oldName, string $newName )

Parameters

$oldName
$newName

Returns

mixed
$this

Throws

rex_exception
rex_exception
public mixed
# removeColumn( string $name )

Parameters

$name

Returns

mixed
$this
public null|string[]
# getPrimaryKey( )

Returns

null|string[]
Column names
public mixed
# setPrimaryKey( null|string|string[] $columns )

Parameters

$columns
Column name(s)

Returns

mixed
$this

Throws

rex_exception
rex_exception
public boolean
# hasIndex( string $name )

Parameters

$name

Returns

boolean
bool
public null|rex_sql_index
# getIndex( string $name )

Parameters

$name

Returns

null|rex_sql_index
null|rex_sql_index
public rex_sql_index[]
# getIndexes( )

Returns

rex_sql_index[]
rex_sql_index[]
public mixed
# addIndex( rex_sql_index $index )

Parameters

$index

Returns

mixed
$this
public mixed
# ensureIndex( rex_sql_index $index )

Parameters

$index

Returns

mixed
$this
public mixed
# renameIndex( string $oldName, string $newName )

Parameters

$oldName
$newName

Returns

mixed
$this

Throws

rex_exception
rex_exception
public mixed
# removeIndex( string $name )

Parameters

$name

Returns

mixed
$this
public boolean
# hasForeignKey( string $name )

Parameters

$name

Returns

boolean
bool
public null|rex_sql_foreign_key
# getForeignKey( string $name )

Parameters

$name

Returns

null|rex_sql_foreign_key
null|rex_sql_foreign_key
public rex_sql_foreign_key[]
# getForeignKeys( )

Returns

rex_sql_foreign_key[]
rex_sql_foreign_key[]
public mixed
# addForeignKey( rex_sql_foreign_key $foreignKey )

Returns

mixed
$this
public mixed
# ensureForeignKey( rex_sql_foreign_key $foreignKey )

Returns

mixed
$this
public mixed
# renameForeignKey( string $oldName, string $newName )

Parameters

$oldName
$newName

Returns

mixed
$this

Throws

rex_exception
rex_exception
public mixed
# removeForeignKey( string $name )

Parameters

$name

Returns

mixed
$this
public
# ensure( )

Ensures that the table exists with the given definition.

Ensures that the table exists with the given definition.

public
# drop( )

Drops the table if it exists.

Drops the table if it exists.

public
# create( )

Creates the table.

Creates the table.

Throws

rex_exception
rex_exception
public
# alter( )

Alters the table.

Alters the table.

Throws

rex_exception
rex_exception

Methods used from rex_instance_pool_trait

addInstance(), clearInstance(), clearInstancePool(), getInstance(), hasInstance()

Constants summary

string FIRST
#'FIRST '
REDAXO 5 API documentation generated by ApiGen 3.0dev