public static dropColumn ( string $strTableName, string $strColumnName, boolean $blnAllowSystemCol = false ) : void | ||
$strTableName | string | The name of the table the column is in. |
$strColumnName | string | The name of the column to drop. |
$blnAllowSystemCol | boolean | If this is set to true, no system column name checking will be applied. |
return | void |
public static function dropColumn($strTableName, $strColumnName, $blnAllowSystemCol = false)
{
self::checkColumnExists($strTableName, $strColumnName, $blnAllowSystemCol);
self::getDB()->execute(sprintf(self::STATEMENT_DROP_COLUMN, $strTableName, $strColumnName));
}
/** * Removes the underlying database structure for this field. * * @return void */ public function deleteColumn() { // Try to delete the column. If it does not exist as we can assume it has been deleted already then. if ($this->getColName() && $this->getMetaModel()->getServiceContainer()->getDatabase()->fieldExists($this->getColName(), $this->getMetaModel()->getTableName(), true)) { TableManipulation::dropColumn($this->getMetaModel()->getTableName(), $this->getColName()); } }