PHP Classes

File: src/SQLTools/Command/AddPrimaryKey.php

Recommend this page to a friend!
  Classes of Rafael Lúcio   SQLTools   src/SQLTools/Command/AddPrimaryKey.php   Download  
File: src/SQLTools/Command/AddPrimaryKey.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/AddPrimaryKey.php
Date: 9 months ago
Size: 302 bytes
 

Contents

Class file image Download
<?php

namespace SQLTools\Command;

class
AddPrimaryKey extends AlterTable {

    private
$fieldName;

    public function
__construct($fieldName)
    {
       
$this->fieldName = $fieldName;
    }

    protected function
getWhatToAdd()
    {
        return
"PRIMARY KEY ({$this->fieldName});";
    }
}