ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilDBPdoFieldDefinition Class Reference

Class ilDBPdoFieldDefinition. More...

+ Inheritance diagram for ilDBPdoFieldDefinition:
+ Collaboration diagram for ilDBPdoFieldDefinition:

Public Member Functions

 __construct (protected \ilDBInterface $db_instance)
 ilDBPdoFieldDefinition constructor. More...
 
array checkTableName (string $table_name)
 
 isReserved (string $table_name)
 
 getAllReserved ()
 
 getReservedMysql ()
 
 setReservedMysql (array $reserved_mysql)
 
 checkColumnName (string $column_name)
 
 checkIndexName (string $a_name)
 
 checkColumnDefinition (array $a_def)
 
 isAllowedAttribute (string $attribute, string $type)
 
 getAvailableTypes ()
 
 setAvailableTypes (array $available_types)
 
 getAllowedAttributes ()
 
 setAllowedAttributes (array $allowed_attributes)
 
 getMaxLength ()
 
 setMaxLength (array $max_length)
 
 getValidTypes ()
 
 getDeclaration (string $type, string $name, array $field)
 
 getTypeDeclaration (array $field)
 
 compareDefinition (array $current, array $previous)
 
 quote ($value, ?string $type=null, bool $quote=true, bool $escape_wildcards=false)
 
 writeLOBToFile ($lob, string $file)
 
 destroyLOB ($lob)
 
 matchPattern (array $pattern, $operator=null, $field=null)
 
 patternEscapeString ()
 
 mapNativeDatatype (array $field)
 
 mapPrepareDatatype (string $type)
 

Data Fields

array $lobs
 
const DEFAULT_DECIMAL_PLACES = 2
 
const DEFAULT_TEXT_LENGTH = 4000
 
const DEFINITION_COLUMN_NAME = "/^[a-z]+[_a-z0-9]*$/"
 
const DEFINITION_TABLE_NAME = "/^[a-z]+[_a-z0-9]*$/"
 
const INDEX_FORMAT = '%s_idx'
 
const SEQUENCE_COLUMNS_NAME = 'sequence'
 
const SEQUENCE_FORMAT = '%s_seq'
 
const T_BLOB = 'blob'
 
const T_CLOB = 'clob'
 
const T_DATE = 'date'
 
const T_DATETIME = 'datetime'
 
const T_FLOAT = 'float'
 
const T_INTEGER = 'integer'
 
const T_TEXT = 'text'
 
const T_TIME = 'time'
 
const T_TIMESTAMP = 'timestamp'
 
array $allowed_attributes_old
 
array $allowed_attributes
 
array integer => ["length"
 
array notnull
 
array default
 
array unsigned
 
array float => ["notnull"
 
array date => ["notnull"
 
array time => ["notnull"
 
array timestamp => ["notnull"
 
array clob => ["length"
 
array blob => ["length"
 

Protected Member Functions

 getQueryUtils ()
 
 getDBInstance ()
 
 getInternalDeclaration (string $name, array $field)
 
 getDeclarationOptions (array $field)
 
 getCharsetFieldDeclaration (string $charset)
 
 getCollationFieldDeclaration (string $collation)
 
 getIntegerDeclaration (string $name, array $field)
 
 getTextDeclaration (string $name, array $field)
 
 getCLOBDeclaration (string $name, array $field)
 
 getBLOBDeclaration (string $name, array $field)
 
 getBooleanDeclaration (string $name, array $field)
 
 getDateDeclaration (string $name, array $field)
 
 getTimestampDeclaration (string $name, array $field)
 
 getTimeDeclaration (string $name, array $field)
 
 getFloatDeclaration (string $name, array $field)
 
 getDecimalDeclaration (string $name, array $field)
 
 compareIntegerDefinition (array $current, array $previous)
 
 compareTextDefinition (array $current, array $previous)
 
 compareCLOBDefinition (array $current, array $previous)
 
 compareBLOBDefinition (array $current, array $previous)
 
 compareDateDefinition (array $current, array $previous)
 
 compareTimeDefinition (array $current, array $previous)
 
 compareTimestampDefinition (array $current, array $previous)
 
 compareBooleanDefinition (array $current, array $previous)
 
 compareFloatDefinition (array $current, array $previous)
 
 compareDecimalDefinition (array $current, array $previous)
 
 quoteInteger ($value, bool $quote, bool $escape_wildcards)
 
 quoteText (string $value, bool $quote, bool $escape_wildcards)
 
 readFile ($value)
 
 quoteLOB ($value, bool $quote, bool $escape_wildcards)
 
 quoteCLOB ($value, bool $quote, bool $escape_wildcards)
 
 quoteBLOB ($value, bool $quote, bool $escape_wildcards)
 
 quoteBoolean (bool $value, bool $quote, bool $escape_wildcards)
 
 quoteDate (string $value, bool $quote, bool $escape_wildcards)
 
 quoteTimestamp (int $value, bool $quote, bool $escape_wildcards)
 
 quoteTime (int $value, bool $quote, bool $escape_wildcards)
 
 quoteFloat (string $value, bool $quote, bool $escape_wildcards)
 
 quoteDecimal (string $value, bool $quote, bool $escape_wildcards)
 
 retrieveLOB (array &$lob)
 
 readLOB (array $lob, int $length)
 
 endOfLOB (array $lob)
 
 mapNativeDatatypeInternal (array $field)
 

Protected Attributes

array array $max_length
 
array $available_types
 
array $reserved_mysql
 
array $reserved_postgres
 
ilMySQLQueryUtils $query_utils = null
 
array $valid_default_values
 

Static Protected Attributes

static ilDBPdoFieldDefinition $instance
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilDBPdoFieldDefinition::__construct ( protected \ilDBInterface  $db_instance)

ilDBPdoFieldDefinition constructor.

Definition at line 826 of file class.ilDBPdoFieldDefinition.php.

827  {
828  }

Member Function Documentation

◆ checkColumnDefinition()

ilDBPdoFieldDefinition::checkColumnDefinition ( array  $a_def)
Exceptions

Definition at line 954 of file class.ilDBPdoFieldDefinition.php.

References getAllowedAttributes(), getAvailableTypes(), getMaxLength(), and null.

954  : bool
955  {
956  // check valid type
957  if (!in_array($a_def["type"], $this->getAvailableTypes(), true)) {
958  switch ($a_def["type"]) {
959  case "boolean":
960  throw new ilDatabaseException("Invalid column type '" . $a_def["type"] . "'. Use integer(1) instead.");
961 
962  case "decimal":
963  throw new ilDatabaseException("Invalid column type '" . $a_def["type"] . "'. Use float or integer instead.");
964 
965  default:
966  throw new ilDatabaseException("Invalid column type '" . $a_def["type"] . "'. Allowed types are: "
967  . implode(', ', $this->getAvailableTypes()));
968  }
969  }
970 
971  // check used attributes
973  foreach (array_keys($a_def) as $k) {
974  if ($k !== "type" && !in_array($k, $allowed_attributes[$a_def["type"]], true)) {
975  throw new ilDatabaseException("Attribute '" . $k . "' is not allowed for column type '" . $a_def["type"] . "'.");
976  }
977  }
978 
979  // type specific checks
980  $max_length = $this->getMaxLength();
981  switch ($a_def["type"]) {
982  case self::T_TEXT:
983  if ((!isset($a_def["length"]) || $a_def["length"] < 1 || $a_def["length"] > $max_length[self::T_TEXT]) && isset($a_def["length"])) {
984  throw new ilDatabaseException("Invalid length '" . $a_def["length"] . "' for type text." . " Length must be >=1 and <= "
985  . $max_length[self::T_TEXT] . ".");
986  }
987  break;
988 
989  case self::T_INTEGER:
990  if (isset($a_def["length"]) && !in_array((int) $a_def["length"], $max_length[self::T_INTEGER], true)) {
991  throw new ilDatabaseException("Invalid length '" . $a_def["length"] . "' for type integer." . " Length must be "
992  . implode(', ', $max_length[self::T_INTEGER]) . " (bytes).");
993  }
994  if ($a_def["unsigned"] ?? null) {
995  throw new ilDatabaseException("Unsigned attribut must not be true for type integer.");
996  }
997  break;
998  }
999 
1000  return true;
1001  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ checkColumnName()

ilDBPdoFieldDefinition::checkColumnName ( string  $column_name)
Exceptions

Definition at line 909 of file class.ilDBPdoFieldDefinition.php.

References isReserved().

909  : bool
910  {
911  if (!preg_match("/^[a-z]+[_a-z0-9]*$/", $column_name)) {
912  throw new ilDatabaseException("Invalid column name '" . $column_name
913  . "'. Column name must only contain _a-z0-9 and must start with a-z.");
914  }
915 
916  if ($this->isReserved($column_name)) {
917  throw new ilDatabaseException("Invalid column name '" . $column_name . "' (Reserved Word).");
918  }
919 
920  if (stripos($column_name, "sys_") === 0) {
921  throw new ilDatabaseException("Invalid column name '" . $column_name . "'. Name must not start with 'sys_'.");
922  }
923 
924  if (strlen($column_name) > 30) {
925  throw new ilDatabaseException("Invalid column name '" . $column_name . "'. Maximum column identifer length is 30 bytes.");
926  }
927 
928  return true;
929  }
+ Here is the call graph for this function:

◆ checkIndexName()

ilDBPdoFieldDefinition::checkIndexName ( string  $a_name)
Exceptions

Definition at line 934 of file class.ilDBPdoFieldDefinition.php.

References isReserved().

934  : bool
935  {
936  if (!preg_match("/^[a-z]+[_a-z0-9]*$/", $a_name)) {
937  throw new ilDatabaseException("Invalid column name '" . $a_name . "'. Column name must only contain _a-z0-9 and must start with a-z.");
938  }
939 
940  if ($this->isReserved($a_name)) {
941  throw new ilDatabaseException("Invalid column name '" . $a_name . "' (Reserved Word).");
942  }
943 
944  if (strlen($a_name) > 3) {
945  throw new ilDatabaseException("Invalid index name '" . $a_name . "'. Maximum index identifer length is 3 bytes.");
946  }
947 
948  return true;
949  }
+ Here is the call graph for this function:

◆ checkTableName()

array ilDBPdoFieldDefinition::checkTableName ( string  $table_name)
Exceptions

Definition at line 855 of file class.ilDBPdoFieldDefinition.php.

References isReserved().

855  : bool
856  {
857  if (!preg_match(self::DEFINITION_TABLE_NAME, $table_name)) {
858  throw new ilDatabaseException('Table name must only contain _a-z0-9 and must start with a-z.');
859  }
860 
861  if ($this->isReserved($table_name)) {
862  throw new ilDatabaseException("Invalid table name '" . $table_name . "' (Reserved Word).");
863  }
864 
865  if (stripos($table_name, "sys_") === 0) {
866  throw new ilDatabaseException("Invalid table name '" . $table_name . "'. Name must not start with 'sys_'.");
867  }
868 
869  if (strlen($table_name) > 22) {
870  throw new ilDatabaseException("Invalid table name '" . $table_name . "'. Maximum table identifer length is 22 bytes.");
871  }
872 
873  return true;
874  }
+ Here is the call graph for this function:

◆ compareBLOBDefinition()

ilDBPdoFieldDefinition::compareBLOBDefinition ( array  $current,
array  $previous 
)
protected
Returns
array<string, bool>

Definition at line 1380 of file class.ilDBPdoFieldDefinition.php.

References compareTextDefinition().

1380  : array
1381  {
1382  return $this->compareTextDefinition($current, $previous);
1383  }
compareTextDefinition(array $current, array $previous)
+ Here is the call graph for this function:

◆ compareBooleanDefinition()

ilDBPdoFieldDefinition::compareBooleanDefinition ( array  $current,
array  $previous 
)
protected

Definition at line 1400 of file class.ilDBPdoFieldDefinition.php.

1400  : array
1401  {
1402  return [];
1403  }

◆ compareCLOBDefinition()

ilDBPdoFieldDefinition::compareCLOBDefinition ( array  $current,
array  $previous 
)
protected
Returns
array<string, bool>

Definition at line 1372 of file class.ilDBPdoFieldDefinition.php.

References compareTextDefinition().

1372  : array
1373  {
1374  return $this->compareTextDefinition($current, $previous);
1375  }
compareTextDefinition(array $current, array $previous)
+ Here is the call graph for this function:

◆ compareDateDefinition()

ilDBPdoFieldDefinition::compareDateDefinition ( array  $current,
array  $previous 
)
protected

Definition at line 1385 of file class.ilDBPdoFieldDefinition.php.

1385  : array
1386  {
1387  return [];
1388  }

◆ compareDecimalDefinition()

ilDBPdoFieldDefinition::compareDecimalDefinition ( array  $current,
array  $previous 
)
protected

Definition at line 1410 of file class.ilDBPdoFieldDefinition.php.

1410  : array
1411  {
1412  return [];
1413  }

◆ compareDefinition()

ilDBPdoFieldDefinition::compareDefinition ( array  $current,
array  $previous 
)
Exceptions

Definition at line 1280 of file class.ilDBPdoFieldDefinition.php.

References getDBInstance(), and null.

1280  : array
1281  {
1282  $type = empty($current['type']) ? null : $current['type'];
1283 
1284  if (!method_exists($this, "compare{$type}Definition")) {
1285  $db = $this->getDBInstance();
1286 
1287  if (!empty($db->options['datatype_map_callback'][$type])) {
1288  $parameter = ['current' => $current, 'previous' => $previous];
1289 
1290  return call_user_func_array(
1291  $db->options['datatype_map_callback'][$type],
1292  [&$db, __FUNCTION__, $parameter]
1293  );
1294  }
1295 
1296  throw new ilDatabaseException('type "' . $current['type'] . '" is not yet supported');
1297  }
1298 
1299  if (empty($previous['type']) || $previous['type'] != $type) {
1300  return $current;
1301  }
1302 
1303  $change = $this->{"compare{$type}Definition"}($current, $previous);
1304 
1305  if ($previous['type'] != $type) {
1306  $change['type'] = true;
1307  }
1308 
1309  $previous_notnull = empty($previous['notnull']) ? false : $previous['notnull'];
1310  $notnull = empty($current['notnull']) ? false : $current['notnull'];
1311  if ($previous_notnull !== $notnull) {
1312  $change['notnull'] = true;
1313  }
1314 
1315  $alt = $previous_notnull ? '' : null;
1316  $previous_default = array_key_exists(
1317  'default',
1318  $previous
1319  ) ? $previous['default'] : $alt;
1320  $alt = $notnull ? '' : null;
1321  $default = array_key_exists('default', $current) ? $current['default'] : $alt;
1322  if ($previous_default !== $default) {
1323  $change['default'] = true;
1324  }
1325 
1326  return $change;
1327  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ compareFloatDefinition()

ilDBPdoFieldDefinition::compareFloatDefinition ( array  $current,
array  $previous 
)
protected

Definition at line 1405 of file class.ilDBPdoFieldDefinition.php.

1405  : array
1406  {
1407  return [];
1408  }

◆ compareIntegerDefinition()

ilDBPdoFieldDefinition::compareIntegerDefinition ( array  $current,
array  $previous 
)
protected
Returns
array<string, bool>

Definition at line 1332 of file class.ilDBPdoFieldDefinition.php.

1332  : array
1333  {
1334  $change = [];
1335  $previous_unsigned = empty($previous['unsigned']) ? false : $previous['unsigned'];
1336  $unsigned = empty($current['unsigned']) ? false : $current['unsigned'];
1337  if ($previous_unsigned != $unsigned) {
1338  $change['unsigned'] = true;
1339  }
1340  $previous_autoincrement = empty($previous['autoincrement']) ? false : $previous['autoincrement'];
1341  $autoincrement = empty($current['autoincrement']) ? false : $current['autoincrement'];
1342  if ($previous_autoincrement != $autoincrement) {
1343  $change['autoincrement'] = true;
1344  }
1345 
1346  return $change;
1347  }

◆ compareTextDefinition()

ilDBPdoFieldDefinition::compareTextDefinition ( array  $current,
array  $previous 
)
protected
Returns
array<string, bool>

Definition at line 1352 of file class.ilDBPdoFieldDefinition.php.

Referenced by compareBLOBDefinition(), and compareCLOBDefinition().

1352  : array
1353  {
1354  $change = [];
1355  $previous_length = empty($previous['length']) ? 0 : $previous['length'];
1356  $length = empty($current['length']) ? 0 : $current['length'];
1357  if ($previous_length != $length) {
1358  $change['length'] = true;
1359  }
1360  $previous_fixed = empty($previous['fixed']) ? 0 : $previous['fixed'];
1361  $fixed = empty($current['fixed']) ? 0 : $current['fixed'];
1362  if ($previous_fixed != $fixed) {
1363  $change['fixed'] = true;
1364  }
1365 
1366  return $change;
1367  }
+ Here is the caller graph for this function:

◆ compareTimeDefinition()

ilDBPdoFieldDefinition::compareTimeDefinition ( array  $current,
array  $previous 
)
protected

Definition at line 1390 of file class.ilDBPdoFieldDefinition.php.

1390  : array
1391  {
1392  return [];
1393  }

◆ compareTimestampDefinition()

ilDBPdoFieldDefinition::compareTimestampDefinition ( array  $current,
array  $previous 
)
protected

Definition at line 1395 of file class.ilDBPdoFieldDefinition.php.

1395  : array
1396  {
1397  return [];
1398  }

◆ destroyLOB()

ilDBPdoFieldDefinition::destroyLOB (   $lob)
Parameters
resource$lob

Definition at line 1617 of file class.ilDBPdoFieldDefinition.php.

1617  : bool
1618  {
1619  $lob_data = stream_get_meta_data($lob);
1620  $lob_index = $lob_data['wrapper_data']->lob_index;
1621  fclose($lob);
1622  if (isset($this->lobs[$lob_index])) {
1623  unset($this->lobs[$lob_index]);
1624  }
1625 
1626  return true;
1627  }

◆ endOfLOB()

ilDBPdoFieldDefinition::endOfLOB ( array  $lob)
protected
Returns
mixed

Definition at line 1609 of file class.ilDBPdoFieldDefinition.php.

1610  {
1611  return $lob['endOfLOB'];
1612  }

◆ getAllowedAttributes()

ilDBPdoFieldDefinition::getAllowedAttributes ( )
Returns
string[]

Definition at line 1027 of file class.ilDBPdoFieldDefinition.php.

References $allowed_attributes.

Referenced by checkColumnDefinition().

1027  : array
1028  {
1030  }
+ Here is the caller graph for this function:

◆ getAllReserved()

ilDBPdoFieldDefinition::getAllReserved ( )
Returns
string[]

Definition at line 884 of file class.ilDBPdoFieldDefinition.php.

References getReservedMysql().

884  : array
885  {
886  return $this->getReservedMysql();
887  }
+ Here is the call graph for this function:

◆ getAvailableTypes()

ilDBPdoFieldDefinition::getAvailableTypes ( )
Returns
string[]

Definition at line 1011 of file class.ilDBPdoFieldDefinition.php.

References $available_types.

Referenced by checkColumnDefinition().

1011  : array
1012  {
1013  return $this->available_types;
1014  }
+ Here is the caller graph for this function:

◆ getBLOBDeclaration()

ilDBPdoFieldDefinition::getBLOBDeclaration ( string  $name,
array  $field 
)
protected

Definition at line 1235 of file class.ilDBPdoFieldDefinition.php.

References getDBInstance(), and getTypeDeclaration().

1235  : string
1236  {
1237  $db = $this->getDBInstance();
1238 
1239  $notnull = empty($field['notnull']) ? '' : ' NOT NULL';
1240  $name = $db->quoteIdentifier($name, true);
1241 
1242  return $name . ' ' . $this->getTypeDeclaration($field) . $notnull;
1243  }
+ Here is the call graph for this function:

◆ getBooleanDeclaration()

ilDBPdoFieldDefinition::getBooleanDeclaration ( string  $name,
array  $field 
)
protected

Definition at line 1245 of file class.ilDBPdoFieldDefinition.php.

References getInternalDeclaration().

1245  : string
1246  {
1247  return $this->getInternalDeclaration($name, $field);
1248  }
getInternalDeclaration(string $name, array $field)
+ Here is the call graph for this function:

◆ getCharsetFieldDeclaration()

ilDBPdoFieldDefinition::getCharsetFieldDeclaration ( string  $charset)
protected

Definition at line 1199 of file class.ilDBPdoFieldDefinition.php.

Referenced by getDeclarationOptions().

1199  : string
1200  {
1201  return '';
1202  }
+ Here is the caller graph for this function:

◆ getCLOBDeclaration()

ilDBPdoFieldDefinition::getCLOBDeclaration ( string  $name,
array  $field 
)
protected

Definition at line 1225 of file class.ilDBPdoFieldDefinition.php.

References getDBInstance(), and getTypeDeclaration().

1225  : string
1226  {
1227  $db = $this->getDBInstance();
1228 
1229  $notnull = empty($field['notnull']) ? '' : ' NOT NULL';
1230  $name = $db->quoteIdentifier($name, true);
1231 
1232  return $name . ' ' . $this->getTypeDeclaration($field) . $notnull;
1233  }
+ Here is the call graph for this function:

◆ getCollationFieldDeclaration()

ilDBPdoFieldDefinition::getCollationFieldDeclaration ( string  $collation)
protected

Definition at line 1204 of file class.ilDBPdoFieldDefinition.php.

Referenced by getDeclarationOptions().

1204  : string
1205  {
1206  return '';
1207  }
+ Here is the caller graph for this function:

◆ getDateDeclaration()

ilDBPdoFieldDefinition::getDateDeclaration ( string  $name,
array  $field 
)
protected

Definition at line 1250 of file class.ilDBPdoFieldDefinition.php.

References getInternalDeclaration().

1250  : string
1251  {
1252  return $this->getInternalDeclaration($name, $field);
1253  }
getInternalDeclaration(string $name, array $field)
+ Here is the call graph for this function:

◆ getDBInstance()

◆ getDecimalDeclaration()

ilDBPdoFieldDefinition::getDecimalDeclaration ( string  $name,
array  $field 
)
protected

Definition at line 1270 of file class.ilDBPdoFieldDefinition.php.

References getInternalDeclaration().

1270  : string
1271  {
1272  return $this->getInternalDeclaration($name, $field);
1273  }
getInternalDeclaration(string $name, array $field)
+ Here is the call graph for this function:

◆ getDeclaration()

ilDBPdoFieldDefinition::getDeclaration ( string  $type,
string  $name,
array  $field 
)
Returns
mixed
Exceptions

Definition at line 1087 of file class.ilDBPdoFieldDefinition.php.

References getDBInstance().

1088  {
1089  $db = $this->getDBInstance();
1090 
1091  if (!empty($db->options['datatype_map'][$type])) {
1092  $type = $db->options['datatype_map'][$type];
1093  if (!empty($db->options['datatype_map_callback'][$type])) {
1094  $parameter = ['type' => $type, 'name' => $name, 'field' => $field];
1095 
1096  return call_user_func_array(
1097  $db->options['datatype_map_callback'][$type],
1098  [&$db, __FUNCTION__, $parameter]
1099  );
1100  }
1101  $field['type'] = $type;
1102  }
1103 
1104  if (!method_exists($this, "get{$type}Declaration")) {
1105  throw new ilDatabaseException('type not defined: ' . $type);
1106  }
1107 
1108  return $this->{"get{$type}Declaration"}($name, $field);
1109  }
+ Here is the call graph for this function:

◆ getDeclarationOptions()

ilDBPdoFieldDefinition::getDeclarationOptions ( array  $field)
protected
Exceptions

Definition at line 1160 of file class.ilDBPdoFieldDefinition.php.

References getCharsetFieldDeclaration(), getCollationFieldDeclaration(), getDBInstance(), getValidTypes(), null, and quote().

1160  : string
1161  {
1162  $charset = empty($field['charset']) ? '' : ' ' . $this->getCharsetFieldDeclaration($field['charset']);
1163 
1164  $default = '';
1165  if (array_key_exists('default', $field)) {
1166  if ($field['default'] === '') {
1167  $db = $this->getDBInstance();
1168 
1169  if (empty($field['notnull'])) {
1170  $field['default'] = null;
1171  } else {
1173  $field['default'] = $valid_default_values[$field['type']];
1174  }
1175  if ($field['default'] === ''
1176  && isset($db->options["portability"])
1177  && ($db->options['portability'] & 32)
1178  ) {
1179  $field['default'] = ' ';
1180  }
1181  }
1182  $default = ' DEFAULT ' . $this->quote($field['default'], $field['type']);
1183  } elseif (empty($field['notnull'])) {
1184  $default = ' DEFAULT NULL';
1185  }
1186 
1187  $notnull = empty($field['notnull']) ? '' : ' NOT NULL';
1188  // alex patch 28 Nov 2011 start
1189  if (isset($field["notnull"]) && $field['notnull'] === false) {
1190  $notnull = " NULL";
1191  }
1192  // alex patch 28 Nov 2011 end
1193 
1194  $collation = empty($field['collation']) ? '' : ' ' . $this->getCollationFieldDeclaration($field['collation']);
1195 
1196  return $charset . $default . $notnull . $collation;
1197  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
quote($value, ?string $type=null, bool $quote=true, bool $escape_wildcards=false)
getCollationFieldDeclaration(string $collation)
+ Here is the call graph for this function:

◆ getFloatDeclaration()

ilDBPdoFieldDefinition::getFloatDeclaration ( string  $name,
array  $field 
)
protected

Definition at line 1265 of file class.ilDBPdoFieldDefinition.php.

References getInternalDeclaration().

1265  : string
1266  {
1267  return $this->getInternalDeclaration($name, $field);
1268  }
getInternalDeclaration(string $name, array $field)
+ Here is the call graph for this function:

◆ getIntegerDeclaration()

ilDBPdoFieldDefinition::getIntegerDeclaration ( string  $name,
array  $field 
)
protected
Exceptions

Definition at line 1212 of file class.ilDBPdoFieldDefinition.php.

References getInternalDeclaration().

1212  : string
1213  {
1214  return $this->getInternalDeclaration($name, $field);
1215  }
getInternalDeclaration(string $name, array $field)
+ Here is the call graph for this function:

◆ getInternalDeclaration()

ilDBPdoFieldDefinition::getInternalDeclaration ( string  $name,
array  $field 
)
protected

Definition at line 1143 of file class.ilDBPdoFieldDefinition.php.

References getDBInstance(), getTypeDeclaration(), and null.

Referenced by getBooleanDeclaration(), getDateDeclaration(), getDecimalDeclaration(), getFloatDeclaration(), getIntegerDeclaration(), getTextDeclaration(), getTimeDeclaration(), and getTimestampDeclaration().

1143  : string
1144  {
1145  $db = $this->getDBInstance();
1146 
1147  $name = $db->quoteIdentifier($name, true);
1148  $declaration_options = '';
1149  $fd = $db->getFieldDefinition();
1150  if ($fd !== null) {
1151  $declaration_options = $fd->getDeclarationOptions($field);
1152  }
1153 
1154  return $name . ' ' . $this->getTypeDeclaration($field) . $declaration_options;
1155  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMaxLength()

ilDBPdoFieldDefinition::getMaxLength ( )

Definition at line 1040 of file class.ilDBPdoFieldDefinition.php.

References $max_length.

Referenced by checkColumnDefinition().

1040  : array
1041  {
1042  return $this->max_length;
1043  }
+ Here is the caller graph for this function:

◆ getQueryUtils()

ilDBPdoFieldDefinition::getQueryUtils ( )
protected

Definition at line 830 of file class.ilDBPdoFieldDefinition.php.

References $query_utils, and null.

831  {
832  if ($this->query_utils === null) {
833  $this->query_utils = new ilMySQLQueryUtils($this->db_instance);
834  }
835 
836  return $this->query_utils;
837  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Class ilMySQLQueryUtils.

◆ getReservedMysql()

ilDBPdoFieldDefinition::getReservedMysql ( )
Returns
string[]

Definition at line 892 of file class.ilDBPdoFieldDefinition.php.

References $reserved_mysql.

Referenced by getAllReserved().

892  : array
893  {
894  return $this->reserved_mysql;
895  }
+ Here is the caller graph for this function:

◆ getTextDeclaration()

ilDBPdoFieldDefinition::getTextDeclaration ( string  $name,
array  $field 
)
protected
Exceptions

Definition at line 1220 of file class.ilDBPdoFieldDefinition.php.

References getInternalDeclaration().

1220  : string
1221  {
1222  return $this->getInternalDeclaration($name, $field);
1223  }
getInternalDeclaration(string $name, array $field)
+ Here is the call graph for this function:

◆ getTimeDeclaration()

ilDBPdoFieldDefinition::getTimeDeclaration ( string  $name,
array  $field 
)
protected

Definition at line 1260 of file class.ilDBPdoFieldDefinition.php.

References getInternalDeclaration().

1260  : string
1261  {
1262  return $this->getInternalDeclaration($name, $field);
1263  }
getInternalDeclaration(string $name, array $field)
+ Here is the call graph for this function:

◆ getTimestampDeclaration()

ilDBPdoFieldDefinition::getTimestampDeclaration ( string  $name,
array  $field 
)
protected

Definition at line 1255 of file class.ilDBPdoFieldDefinition.php.

References getInternalDeclaration().

1255  : string
1256  {
1257  return $this->getInternalDeclaration($name, $field);
1258  }
getInternalDeclaration(string $name, array $field)
+ Here is the call graph for this function:

◆ getTypeDeclaration()

ilDBPdoFieldDefinition::getTypeDeclaration ( array  $field)

Definition at line 1111 of file class.ilDBPdoFieldDefinition.php.

References getDBInstance().

Referenced by getBLOBDeclaration(), getCLOBDeclaration(), and getInternalDeclaration().

1111  : string
1112  {
1113  $db = $this->getDBInstance();
1114 
1115  switch ($field['type']) {
1116  case 'text':
1117  $length = empty($field['length']) ? $db->options['default_text_field_length'] : $field['length'];
1118  $fixed = empty($field['fixed']) ? false : $field['fixed'];
1119  if ($fixed) {
1120  return $length ? 'CHAR(' . $length . ')' : 'CHAR(' . $db->options['default_text_field_length'] . ')';
1121  }
1122 
1123  return $length ? 'VARCHAR(' . $length . ')' : 'TEXT';
1124  case 'clob':
1125  case 'decimal':
1126  case 'float':
1127  case 'blob':
1128  return 'TEXT';
1129  case 'integer':
1130  case 'boolean':
1131  return 'INT';
1132  case 'date':
1133  return 'CHAR (' . strlen('YYYY-MM-DD') . ')';
1134  case 'time':
1135  return 'CHAR (' . strlen('HH:MM:SS') . ')';
1136  case 'timestamp':
1137  return 'CHAR (' . strlen('YYYY-MM-DD HH:MM:SS') . ')';
1138  }
1139 
1140  return '';
1141  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValidTypes()

ilDBPdoFieldDefinition::getValidTypes ( )
Returns
string[]

Definition at line 1058 of file class.ilDBPdoFieldDefinition.php.

References $valid_default_values, and getDBInstance().

Referenced by getDeclarationOptions().

1058  : array
1059  {
1060  $types = $this->valid_default_values;
1061  $db = $this->getDBInstance();
1062 
1063  if (!empty($db->options['datatype_map'])) {
1064  foreach ($db->options['datatype_map'] as $type => $mapped_type) {
1065  if (array_key_exists($mapped_type, $types)) {
1066  $types[$type] = $types[$mapped_type];
1067  } elseif (!empty($db->options['datatype_map_callback'][$type])) {
1068  $parameter = ['type' => $type, 'mapped_type' => $mapped_type];
1069  $default = call_user_func_array(
1070  $db->options['datatype_map_callback'][$type],
1071  [&$db, __FUNCTION__, $parameter]
1072  );
1073  $types[$type] = $default;
1074  }
1075  }
1076  }
1077 
1078  return $types;
1079  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isAllowedAttribute()

ilDBPdoFieldDefinition::isAllowedAttribute ( string  $attribute,
string  $type 
)

Definition at line 1003 of file class.ilDBPdoFieldDefinition.php.

1003  : bool
1004  {
1005  return in_array($attribute, $this->allowed_attributes[$type], true);
1006  }

◆ isReserved()

ilDBPdoFieldDefinition::isReserved ( string  $table_name)

Definition at line 876 of file class.ilDBPdoFieldDefinition.php.

Referenced by checkColumnName(), checkIndexName(), and checkTableName().

876  : bool
877  {
878  return false;
879  }
+ Here is the caller graph for this function:

◆ mapNativeDatatype()

ilDBPdoFieldDefinition::mapNativeDatatype ( array  $field)
Returns
mixed

Definition at line 1683 of file class.ilDBPdoFieldDefinition.php.

References getDBInstance(), and mapNativeDatatypeInternal().

1684  {
1685  $db = $this->getDBInstance();
1686  $db_type = strtok($field['type'], '(), ');
1687  if (!empty($db->options['nativetype_map_callback'][$db_type])) {
1688  return call_user_func_array($db->options['nativetype_map_callback'][$db_type], [$db, $field]);
1689  }
1690 
1691  return $this->mapNativeDatatypeInternal($field);
1692  }
mapNativeDatatypeInternal(array $field)
+ Here is the call graph for this function:

◆ mapNativeDatatypeInternal()

ilDBPdoFieldDefinition::mapNativeDatatypeInternal ( array  $field)
abstractprotected
Exceptions

Referenced by mapNativeDatatype().

+ Here is the caller graph for this function:

◆ mapPrepareDatatype()

ilDBPdoFieldDefinition::mapPrepareDatatype ( string  $type)
Returns
mixed

Definition at line 1702 of file class.ilDBPdoFieldDefinition.php.

References getDBInstance().

1703  {
1704  $db = $this->getDBInstance();
1705 
1706  if (!empty($db->options['datatype_map'][$type])) {
1707  $type = $db->options['datatype_map'][$type];
1708  if (!empty($db->options['datatype_map_callback'][$type])) {
1709  $parameter = ['type' => $type];
1710 
1711  return call_user_func_array(
1712  $db->options['datatype_map_callback'][$type],
1713  [&$db, __FUNCTION__, $parameter]
1714  );
1715  }
1716  }
1717 
1718  return $type;
1719  }
+ Here is the call graph for this function:

◆ matchPattern()

ilDBPdoFieldDefinition::matchPattern ( array  $pattern,
  $operator = null,
  $field = null 
)
Exceptions

Definition at line 1633 of file class.ilDBPdoFieldDefinition.php.

References getDBInstance(), and patternEscapeString().

1633  : string
1634  {
1635  $db = $this->getDBInstance();
1636 
1637  $match = '';
1638  if (!is_null($operator)) {
1639  $operator = strtoupper((string) $operator);
1640  switch ($operator) {
1641  // case insensitive
1642  case 'ILIKE':
1643  if (is_null($field)) {
1644  throw new ilDatabaseException('case insensitive LIKE matching requires passing the field name');
1645  }
1646  $db->loadModule('Function');
1647  $match = $db->lower($field) . ' LIKE ';
1648  break;
1649  // case sensitive
1650  case 'LIKE':
1651  $match = is_null($field) ? 'LIKE ' : $field . ' LIKE ';
1652  break;
1653  default:
1654  throw new ilDatabaseException('not a supported operator type:' . $operator);
1655  }
1656  }
1657  $match .= "'";
1658  foreach ($pattern as $key => $value) {
1659  if ($key % 2 !== 0) {
1660  $match .= $value;
1661  } else {
1662  if ($operator === 'ILIKE') {
1663  $value = strtolower((string) $value);
1664  }
1665  $escaped = $db->escape($value);
1666  $match .= $db->escapePattern($escaped);
1667  }
1668  }
1669  $match .= "'";
1670  $match .= $this->patternEscapeString();
1671 
1672  return $match;
1673  }
+ Here is the call graph for this function:

◆ patternEscapeString()

ilDBPdoFieldDefinition::patternEscapeString ( )

Definition at line 1675 of file class.ilDBPdoFieldDefinition.php.

Referenced by matchPattern().

1675  : string
1676  {
1677  return '';
1678  }
+ Here is the caller graph for this function:

◆ quote()

ilDBPdoFieldDefinition::quote (   $value,
?string  $type = null,
bool  $quote = true,
bool  $escape_wildcards = false 
)
Parameters
mixed$value

Definition at line 1418 of file class.ilDBPdoFieldDefinition.php.

References getDBInstance().

Referenced by getDeclarationOptions(), and ilDBPdoMySQLFieldDefinition\getIntegerDeclaration().

1418  : string
1419  {
1420  return $this->getDBInstance()->quote($value, $type ?? '');
1421  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quoteBLOB()

ilDBPdoFieldDefinition::quoteBLOB (   $value,
bool  $quote,
bool  $escape_wildcards 
)
protected
Parameters
string | resource$value

Definition at line 1494 of file class.ilDBPdoFieldDefinition.php.

References quoteLOB().

1494  : string
1495  {
1496  return $this->quoteLOB($value, $quote, $escape_wildcards);
1497  }
quoteLOB($value, bool $quote, bool $escape_wildcards)
+ Here is the call graph for this function:

◆ quoteBoolean()

ilDBPdoFieldDefinition::quoteBoolean ( bool  $value,
bool  $quote,
bool  $escape_wildcards 
)
protected

Definition at line 1499 of file class.ilDBPdoFieldDefinition.php.

1499  : int
1500  {
1501  return ($value ? 1 : 0);
1502  }

◆ quoteCLOB()

ilDBPdoFieldDefinition::quoteCLOB (   $value,
bool  $quote,
bool  $escape_wildcards 
)
protected
Parameters
string | resource$value

Definition at line 1487 of file class.ilDBPdoFieldDefinition.php.

References quoteLOB().

1487  : string
1488  {
1489  return $this->quoteLOB($value, $quote, $escape_wildcards);
1490  }
quoteLOB($value, bool $quote, bool $escape_wildcards)
+ Here is the call graph for this function:

◆ quoteDate()

ilDBPdoFieldDefinition::quoteDate ( string  $value,
bool  $quote,
bool  $escape_wildcards 
)
protected

Definition at line 1504 of file class.ilDBPdoFieldDefinition.php.

References quoteText().

1504  : string
1505  {
1506  if ($value === 'CURRENT_DATE') {
1507  return 'CURRENT_DATE';
1508  }
1509 
1510  return $this->quoteText($value, $quote, $escape_wildcards);
1511  }
quoteText(string $value, bool $quote, bool $escape_wildcards)
+ Here is the call graph for this function:

◆ quoteDecimal()

ilDBPdoFieldDefinition::quoteDecimal ( string  $value,
bool  $quote,
bool  $escape_wildcards 
)
protected

Definition at line 1541 of file class.ilDBPdoFieldDefinition.php.

Referenced by quoteFloat().

1541  : ?string
1542  {
1543  $value = preg_replace('/[^\d\.,\-+eE]/', '', $value);
1544  if (preg_match('/[^.0-9]/', (string) $value) && strpos((string) $value, ',')) {
1545  // 1000,00
1546  if (!strpos((string) $value, '.')) {
1547  // convert the last "," to a "."
1548  $value = strrev(str_replace(',', '.', strrev((string) $value)));
1549  // 1.000,00
1550  } elseif (strpos((string) $value, '.') && strpos((string) $value, '.') < strpos((string) $value, ',')) {
1551  $value = str_replace('.', '', $value);
1552  // convert the last "," to a "."
1553  $value = strrev(str_replace(',', '.', strrev($value)));
1554  // 1,000.00
1555  } else {
1556  $value = str_replace(',', '', $value);
1557  }
1558  }
1559 
1560  return $value;
1561  }
+ Here is the caller graph for this function:

◆ quoteFloat()

ilDBPdoFieldDefinition::quoteFloat ( string  $value,
bool  $quote,
bool  $escape_wildcards 
)
protected

Definition at line 1529 of file class.ilDBPdoFieldDefinition.php.

References quoteDecimal().

1529  : ?string
1530  {
1531  if (preg_match('/^(.*)e([-+])(\d+)$/i', $value, $matches)) {
1532  $decimal = $this->quoteDecimal($matches[1], $quote, $escape_wildcards);
1533  $sign = $matches[2];
1534  $exponent = str_pad($matches[3], 2, '0', STR_PAD_LEFT);
1535  return $decimal . 'E' . $sign . $exponent;
1536  }
1537 
1538  return $this->quoteDecimal($value, $quote, $escape_wildcards);
1539  }
quoteDecimal(string $value, bool $quote, bool $escape_wildcards)
+ Here is the call graph for this function:

◆ quoteInteger()

ilDBPdoFieldDefinition::quoteInteger (   $value,
bool  $quote,
bool  $escape_wildcards 
)
protected
Parameters
mixed$value

Definition at line 1426 of file class.ilDBPdoFieldDefinition.php.

1426  : int
1427  {
1428  return (int) $value;
1429  }

◆ quoteLOB()

ilDBPdoFieldDefinition::quoteLOB (   $value,
bool  $quote,
bool  $escape_wildcards 
)
protected
Parameters
string | resource$value

Definition at line 1478 of file class.ilDBPdoFieldDefinition.php.

References quoteText(), and readFile().

Referenced by quoteBLOB(), and quoteCLOB().

1478  : string
1479  {
1480  $value = $this->readFile($value);
1481 
1482  return $this->quoteText($value, $quote, $escape_wildcards);
1483  }
quoteText(string $value, bool $quote, bool $escape_wildcards)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quoteText()

ilDBPdoFieldDefinition::quoteText ( string  $value,
bool  $quote,
bool  $escape_wildcards 
)
protected

Definition at line 1431 of file class.ilDBPdoFieldDefinition.php.

References getDBInstance().

Referenced by quoteDate(), and quoteLOB().

1431  : string
1432  {
1433  if (!$quote) {
1434  return $value;
1435  }
1436 
1437  $db = $this->getDBInstance();
1438 
1439  $value = $db->escape($value, $escape_wildcards);
1440 
1441  return "'" . $value . "'";
1442  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quoteTime()

ilDBPdoFieldDefinition::quoteTime ( int  $value,
bool  $quote,
bool  $escape_wildcards 
)
protected
Deprecated:

Definition at line 1524 of file class.ilDBPdoFieldDefinition.php.

1524  : string
1525  {
1526  throw new ilDatabaseException("deprecated");
1527  }

◆ quoteTimestamp()

ilDBPdoFieldDefinition::quoteTimestamp ( int  $value,
bool  $quote,
bool  $escape_wildcards 
)
protected
Deprecated:

Definition at line 1516 of file class.ilDBPdoFieldDefinition.php.

1516  : string
1517  {
1518  throw new ilDatabaseException("deprecated");
1519  }

◆ readFile()

ilDBPdoFieldDefinition::readFile (   $value)
protected
Parameters
string | resource$value

Definition at line 1447 of file class.ilDBPdoFieldDefinition.php.

References getDBInstance().

Referenced by quoteLOB().

1447  : string
1448  {
1449  $close = false;
1450  if (is_string($value) && preg_match('/^(\w+:\/\/)(.*)$/', $value, $match)) {
1451  $close = true;
1452  if ($match[1] === 'file://') {
1453  $value = $match[2];
1454  }
1455  // do not try to open urls
1456  #$value = @fopen($value, 'r');
1457  }
1458 
1459  if (is_resource($value)) {
1460  $db = $this->getDBInstance();
1461 
1462  $fp = $value;
1463  $value = '';
1464  while (!@feof($fp)) {
1465  $value .= @fread($fp, $db->options['lob_buffer_length']);
1466  }
1467  if ($close) {
1468  @fclose($fp);
1469  }
1470  }
1471 
1472  return $value;
1473  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readLOB()

ilDBPdoFieldDefinition::readLOB ( array  $lob,
int  $length 
)
protected

Definition at line 1601 of file class.ilDBPdoFieldDefinition.php.

1601  : string
1602  {
1603  return substr((string) $lob['value'], $lob['position'], $length);
1604  }

◆ retrieveLOB()

ilDBPdoFieldDefinition::retrieveLOB ( array &  $lob)
protected

Definition at line 1591 of file class.ilDBPdoFieldDefinition.php.

1591  : bool
1592  {
1593  if (is_null($lob['value'])) {
1594  $lob['value'] = $lob['resource'];
1595  }
1596  $lob['loaded'] = true;
1597 
1598  return true;
1599  }

◆ setAllowedAttributes()

ilDBPdoFieldDefinition::setAllowedAttributes ( array  $allowed_attributes)
Parameters
string[]$allowed_attributes

Definition at line 1035 of file class.ilDBPdoFieldDefinition.php.

References $allowed_attributes.

1035  : void
1036  {
1037  $this->allowed_attributes = $allowed_attributes;
1038  }

◆ setAvailableTypes()

ilDBPdoFieldDefinition::setAvailableTypes ( array  $available_types)
Parameters
string[]$available_types

Definition at line 1019 of file class.ilDBPdoFieldDefinition.php.

References $available_types.

1019  : void
1020  {
1021  $this->available_types = $available_types;
1022  }

◆ setMaxLength()

ilDBPdoFieldDefinition::setMaxLength ( array  $max_length)

Definition at line 1045 of file class.ilDBPdoFieldDefinition.php.

References $max_length.

1045  : void
1046  {
1047  $this->max_length = $max_length;
1048  }

◆ setReservedMysql()

ilDBPdoFieldDefinition::setReservedMysql ( array  $reserved_mysql)
Parameters
string[]$reserved_mysql

Definition at line 900 of file class.ilDBPdoFieldDefinition.php.

References $reserved_mysql.

900  : void
901  {
902  $this->reserved_mysql = $reserved_mysql;
903  }

◆ writeLOBToFile()

ilDBPdoFieldDefinition::writeLOBToFile (   $lob,
string  $file 
)
Parameters
resource$lob
Exceptions

Definition at line 1568 of file class.ilDBPdoFieldDefinition.php.

References getDBInstance().

1568  : bool
1569  {
1570  $db = $this->getDBInstance();
1571 
1572  if (preg_match('/^(\w+:\/\/)(.*)$/', $file, $match) && $match[1] === 'file://') {
1573  $file = $match[2];
1574  }
1575 
1576  $fp = @fopen($file, 'wb');
1577  while (!@feof($lob)) {
1578  $result = @fread($lob, $db->options['lob_buffer_length']);
1579  $read = strlen($result);
1580  if (@fwrite($fp, $result, $read) !== $read) {
1581  @fclose($fp);
1582 
1583  throw new ilDatabaseException('could not write to the output file');
1584  }
1585  }
1586  @fclose($fp);
1587 
1588  return true;
1589  }
+ Here is the call graph for this function:

Field Documentation

◆ $allowed_attributes

array ilDBPdoFieldDefinition::$allowed_attributes
Initial value:
= [
"text" => ["length", "notnull", "default", "fixed"]

Definition at line 61 of file class.ilDBPdoFieldDefinition.php.

Referenced by getAllowedAttributes(), and setAllowedAttributes().

◆ $allowed_attributes_old

array ilDBPdoFieldDefinition::$allowed_attributes_old
Initial value:
= [
self::T_TEXT => ['length', 'notnull', 'default', 'fixed']

Definition at line 48 of file class.ilDBPdoFieldDefinition.php.

◆ $available_types

array ilDBPdoFieldDefinition::$available_types
protected
Initial value:
= [
self::T_TEXT,
self::T_INTEGER,
self::T_FLOAT,
self::T_DATE,
self::T_TIME,
self::T_TIMESTAMP,
self::T_CLOB,
self::T_BLOB,
]

Definition at line 78 of file class.ilDBPdoFieldDefinition.php.

Referenced by getAvailableTypes(), and setAvailableTypes().

◆ $instance

ilDBPdoFieldDefinition ilDBPdoFieldDefinition::$instance
staticprotected

Definition at line 44 of file class.ilDBPdoFieldDefinition.php.

◆ $lobs

array ilDBPdoFieldDefinition::$lobs

Definition at line 27 of file class.ilDBPdoFieldDefinition.php.

◆ $max_length

array array ilDBPdoFieldDefinition::$max_length
protected
Initial value:
= [
self::T_INTEGER => [1, 2, 3, 4, 8]

Definition at line 71 of file class.ilDBPdoFieldDefinition.php.

Referenced by getMaxLength(), and setMaxLength().

◆ $query_utils

ilMySQLQueryUtils ilDBPdoFieldDefinition::$query_utils = null
protected

Definition at line 821 of file class.ilDBPdoFieldDefinition.php.

Referenced by getQueryUtils().

◆ $reserved_mysql

array ilDBPdoFieldDefinition::$reserved_mysql
protected

Definition at line 91 of file class.ilDBPdoFieldDefinition.php.

Referenced by getReservedMysql(), and setReservedMysql().

◆ $reserved_postgres

array ilDBPdoFieldDefinition::$reserved_postgres
protected

Definition at line 721 of file class.ilDBPdoFieldDefinition.php.

◆ $valid_default_values

array ilDBPdoFieldDefinition::$valid_default_values
protected
Initial value:
= [
'text' => ''

Definition at line 839 of file class.ilDBPdoFieldDefinition.php.

Referenced by getValidTypes().

◆ blob

array ilDBPdoFieldDefinition::blob => ["length"

Definition at line 69 of file class.ilDBPdoFieldDefinition.php.

◆ clob

array ilDBPdoFieldDefinition::clob => ["length"

Definition at line 68 of file class.ilDBPdoFieldDefinition.php.

◆ date

array ilDBPdoFieldDefinition::date => ["notnull"

Definition at line 65 of file class.ilDBPdoFieldDefinition.php.

◆ default

array ilDBPdoFieldDefinition::default

Definition at line 63 of file class.ilDBPdoFieldDefinition.php.

◆ DEFAULT_DECIMAL_PLACES

const ilDBPdoFieldDefinition::DEFAULT_DECIMAL_PLACES = 2

Definition at line 28 of file class.ilDBPdoFieldDefinition.php.

◆ DEFAULT_TEXT_LENGTH

const ilDBPdoFieldDefinition::DEFAULT_TEXT_LENGTH = 4000

Definition at line 29 of file class.ilDBPdoFieldDefinition.php.

◆ DEFINITION_COLUMN_NAME

const ilDBPdoFieldDefinition::DEFINITION_COLUMN_NAME = "/^[a-z]+[_a-z0-9]*$/"

Definition at line 30 of file class.ilDBPdoFieldDefinition.php.

◆ DEFINITION_TABLE_NAME

const ilDBPdoFieldDefinition::DEFINITION_TABLE_NAME = "/^[a-z]+[_a-z0-9]*$/"

Definition at line 31 of file class.ilDBPdoFieldDefinition.php.

◆ float

array ilDBPdoFieldDefinition::float => ["notnull"

Definition at line 64 of file class.ilDBPdoFieldDefinition.php.

◆ INDEX_FORMAT

const ilDBPdoFieldDefinition::INDEX_FORMAT = '%s_idx'

◆ integer

array ilDBPdoFieldDefinition::integer => ["length"

Definition at line 63 of file class.ilDBPdoFieldDefinition.php.

◆ notnull

array ilDBPdoFieldDefinition::notnull

Definition at line 63 of file class.ilDBPdoFieldDefinition.php.

◆ SEQUENCE_COLUMNS_NAME

const ilDBPdoFieldDefinition::SEQUENCE_COLUMNS_NAME = 'sequence'

Definition at line 33 of file class.ilDBPdoFieldDefinition.php.

◆ SEQUENCE_FORMAT

const ilDBPdoFieldDefinition::SEQUENCE_FORMAT = '%s_seq'

Definition at line 34 of file class.ilDBPdoFieldDefinition.php.

Referenced by ilDBPdo\getSequenceName().

◆ T_BLOB

const ilDBPdoFieldDefinition::T_BLOB = 'blob'

Definition at line 35 of file class.ilDBPdoFieldDefinition.php.

◆ T_CLOB

const ilDBPdoFieldDefinition::T_CLOB = 'clob'

Definition at line 36 of file class.ilDBPdoFieldDefinition.php.

◆ T_DATE

const ilDBPdoFieldDefinition::T_DATE = 'date'

Definition at line 37 of file class.ilDBPdoFieldDefinition.php.

◆ T_DATETIME

const ilDBPdoFieldDefinition::T_DATETIME = 'datetime'

Definition at line 38 of file class.ilDBPdoFieldDefinition.php.

◆ T_FLOAT

const ilDBPdoFieldDefinition::T_FLOAT = 'float'

Definition at line 39 of file class.ilDBPdoFieldDefinition.php.

◆ T_INTEGER

const ilDBPdoFieldDefinition::T_INTEGER = 'integer'

Definition at line 40 of file class.ilDBPdoFieldDefinition.php.

◆ T_TEXT

const ilDBPdoFieldDefinition::T_TEXT = 'text'

Definition at line 41 of file class.ilDBPdoFieldDefinition.php.

◆ T_TIME

const ilDBPdoFieldDefinition::T_TIME = 'time'

Definition at line 42 of file class.ilDBPdoFieldDefinition.php.

◆ T_TIMESTAMP

const ilDBPdoFieldDefinition::T_TIMESTAMP = 'timestamp'

Definition at line 43 of file class.ilDBPdoFieldDefinition.php.

◆ time

array ilDBPdoFieldDefinition::time => ["notnull"

Definition at line 66 of file class.ilDBPdoFieldDefinition.php.

◆ timestamp

array ilDBPdoFieldDefinition::timestamp => ["notnull"

Definition at line 67 of file class.ilDBPdoFieldDefinition.php.

◆ unsigned

array ilDBPdoFieldDefinition::unsigned

Definition at line 63 of file class.ilDBPdoFieldDefinition.php.


The documentation for this class was generated from the following file: