PHP Classes

File: src/SQLTools/Command/ChangeField.php

Recommend this page to a friend!
  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: Update of src/SQLTools/Command/ChangeField.php
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();
    }

}