protected function setKey(Field & $field, $key, $extra)
    {
        $key = strtoupper($key);

        if ($key == 'PRIMARY KEY') {
            $field->isPrimary = true;
        }

        if ($key == 'MUL') {
            $field->isIndex = true;
        }

        if ($key == 'UNI') {
            $field->isUnique = true;
        }

        if (strtolower($extra) == 'auto_increment') {
            $field->isAutoIncrement = true;
        }

        return $this;
    }
protected function setKey(Field & $field, $key, $extra)
    {
        $key = strtoupper($key);

        if ($key == 'PRIMARY KEY') {
            $field->isPrimary = true;
        }

        if ($key == 'MUL') {
            $field->isIndex = true;
        }

        if ($key == 'UNI') {
            $field->isUnique = true;
        }

        if (strtolower($extra) == 'auto_increment') {
            $field->isAutoIncrement = true;
        }

        return $this;
    }
protected function setKey ( Field & $ field , $ key , $ extra ) { $ key = strtoupper ( $ key ) ; if ( $ key == 'PRIMARY KEY' ) { $ field -> isPrimary = true ; } if ( $ key == 'MUL' ) { $ field -> isIndex = true ; } if ( $ key == 'UNI' ) { $ field -> isUnique = true ; } if ( strtolower ( $ extra ) == 'auto_increment' ) { $ field -> isAutoIncrement = true ; } return $ this ; }
Set the keys for a given field.

@param CrestApps\CodeGenerator\Models\Field $field
@param string $key
@param string $extra

@return $this
Set the keys for a given field .