MetaModels\Helper\TableManipulation::checkColumnExists PHP Method

checkColumnExists() public static method

Checks whether the given table exists.
public static checkColumnExists ( string $strTableName, string $strColName, boolean $blnAllowSystemCol = false ) : void
$strTableName string The table name to check.
$strColName string The column name to check.
$blnAllowSystemCol boolean If this is set to true, no system column name checking will be applied.
return void
    public static function checkColumnExists($strTableName, $strColName, $blnAllowSystemCol = false)
    {
        self::checkTableExists($strTableName);
        self::checkColumnName($strColName, $blnAllowSystemCol);
        if (!self::getDB()->fieldExists($strColName, $strTableName, true)) {
            throw new \Exception(sprintf($GLOBALS['TL_LANG']['ERR']['columnDoesNotExist'], $strColName, $strTableName));
        }
    }