PHP Classes
elePHPant
Icontem

File: src/SQLTools/Command/ChangeField.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Rafael Lúcio  >  SQLTools  >  src/SQLTools/Command/ChangeField.php  >  Download  
File: src/SQLTools/Command/ChangeField.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: SQLTools
Create and alter databases, tables and indexes
Author: By
Last change: fixed change field bug

added white space between the change field command
Date: 9 months ago
Size: 599 bytes
 

Contents

Class file image Download
<?php

namespace SQLTools\Command;


use
SQLTools\Base\AlterTableEnum;
use
SQLTools\Entity\Field;

class
ChangeField extends AlterTable {

    protected
$changeType = AlterTableEnum::CHANGE;

    private
$fieldToChange;
   
/**
     * @var Field $field
     */
   
private $field;

    public function
__construct($table, $fieldToChange, Field $field)
    {
       
$this->table = $table;
       
$this->fieldToChange = $fieldToChange;
       
$this->field = $field;
    }

    protected function
getWhatToAdd()
    {
        return
$this->fieldToChange . " " . $this->field->__toString();
    }

}