protected function addColumn($col, $type)
    {
        if (empty($col)) {
            return Yii::t('podium/flash', 'Installation aborted! Column name missing.');
        }
        if (empty($type)) {
            return Yii::t('podium/flash', 'Installation aborted! Column type missing.');
        }
        try {
            $this->db->createCommand()->addColumn($this->table, $col, $type)->execute();
            return $this->returnSuccess(Yii::t('podium/flash', 'Table column {name} has been added', ['name' => $col]));
        } catch (Exception $e) {
            return $this->returnError($e->getMessage(), __METHOD__,
                Yii::t('podium/flash', 'Error during table column {name} adding', ['name' => $col])
            );
        }
    }
protected function addColumn($col, $type)
    {
        if (empty($col)) {
            return Yii::t('podium/flash', 'Installation aborted! Column name missing.');
        }
        if (empty($type)) {
            return Yii::t('podium/flash', 'Installation aborted! Column type missing.');
        }
        try {
            $this->db->createCommand()->addColumn($this->table, $col, $type)->execute();
            return $this->returnSuccess(Yii::t('podium/flash', 'Table column {name} has been added', ['name' => $col]));
        } catch (Exception $e) {
            return $this->returnError($e->getMessage(), __METHOD__,
                Yii::t('podium/flash', 'Error during table column {name} adding', ['name' => $col])
            );
        }
    }
protected function addColumn ( $ col , $ type ) { if ( empty ( $ col ) ) { return Yii :: t ( 'podium/flash' , 'Installation aborted! Column name missing.' ) ; } if ( empty ( $ type ) ) { return Yii :: t ( 'podium/flash' , 'Installation aborted! Column type missing.' ) ; } try { $ this -> db -> createCommand ( ) -> addColumn ( $ this -> table , $ col , $ type ) -> execute ( ) ; return $ this -> returnSuccess ( Yii :: t ( 'podium/flash' , 'Table column {name} has been added' , [ 'name' => $ col ] ) ) ; } catch ( Exception $ e ) { return $ this -> returnError ( $ e -> getMessage ( ) , __METHOD__ , Yii :: t ( 'podium/flash' , 'Error during table column {name} adding' , [ 'name' => $ col ] ) ) ; } }
Adds column to database table.
@param string $col column name
@param string $type column schema
@return string result message
Adds column to database table .