Craft\m160416_000000_seomatic_addContactPoints::_addColumnsAfter PHP Method

_addColumnsAfter() private method

private _addColumnsAfter ( $tableName, $newColumns, $afterColumnHandle )
    private function _addColumnsAfter($tableName, $newColumns, $afterColumnHandle)
    {
        // this is a foreach loop, enough said
        foreach ($newColumns as $columnName => $columnType) {
            // check if the column does NOT exist
            if (!craft()->db->columnExists($tableName, $columnName)) {
                $this->addColumnAfter($tableName, $columnName, array('column' => $columnType, 'null' => false), $afterColumnHandle);
                // log that we created the new column
                SeomaticPlugin::log("Created the `{$columnName}` in the `{$tableName}` table.", LogLevel::Info, true);
            } else {
                // tell craft that we couldn't create the column as it alredy exists.
                SeomaticPlugin::log("Column `{$columnName}` already exists in the `{$tableName}` table.", LogLevel::Info, true);
            }
        }
    }
m160416_000000_seomatic_addContactPoints